Is it possible to program my esp8266 with esphome so that when flashing a new update, the global variables persist?
I control an espresso machine and I'm counting the number of shots pulled but it resets to 0 (and will reset to 0 at every reset). I also have sliders to fine tune the desired parameters that also get reset to their default position
here's my relevant snippet of code
globals:
- id: shots_pulled
type: int
restore_value: yes
initial_value: '0'
number:
- platform: template # Home assistant widget to set target pressure
id: target_pressure
name: Target Pressure
min_value: 0
max_value: 2
initial_value: 0.95
step: 0.01
optimistic: true
restore_value: true
unit_of_measurement: "bar"
icon: "mdi:kettle-alert"
- platform: template # Home assistant widget to set target temperature
id: target_temperature
name: Target Temperature
min_value: 70
max_value: 100
initial_value: 85
step: 1
optimistic: true
restore_value: true
unit_of_measurement: "°C"
icon: "mdi:thermometer-check"