mirror of
https://github.com/Crocmagnon/plant-badger.git
synced 2024-11-22 17:38:02 +01:00
Move RTC timer set/clear to main function in plant app
This commit is contained in:
parent
3d7d12bf88
commit
25b5e1a290
1 changed files with 5 additions and 4 deletions
|
@ -151,10 +151,13 @@ def main():
|
||||||
# Call halt in a loop, on battery this switches off power.
|
# Call halt in a loop, on battery this switches off power.
|
||||||
# On USB, the app will exit when A+C is pressed because the launcher picks that up.
|
# On USB, the app will exit when A+C is pressed because the launcher picks that up.
|
||||||
while True:
|
while True:
|
||||||
|
display.rtc.clear_timer_flag()
|
||||||
fetch_and_display()
|
fetch_and_display()
|
||||||
|
display.rtc.set_timer(
|
||||||
|
secrets.REFRESH_INTERVAL_MINUTES, ttp=PCF85063A.TIMER_TICK_1_OVER_60HZ
|
||||||
|
)
|
||||||
print("Halting")
|
print("Halting")
|
||||||
display.halt()
|
display.halt()
|
||||||
display.rtc.clear_timer_flag()
|
|
||||||
|
|
||||||
|
|
||||||
def fetch_and_display():
|
def fetch_and_display():
|
||||||
|
@ -164,12 +167,10 @@ def fetch_and_display():
|
||||||
display_header("Chargement...")
|
display_header("Chargement...")
|
||||||
display.set_update_speed(UPDATE_FAST)
|
display.set_update_speed(UPDATE_FAST)
|
||||||
display.update()
|
display.update()
|
||||||
|
|
||||||
plant = HAPlant()
|
plant = HAPlant()
|
||||||
plant.fetch_states()
|
plant.fetch_states()
|
||||||
plant.display_state()
|
plant.display_state()
|
||||||
display.rtc.set_timer(
|
|
||||||
secrets.REFRESH_INTERVAL_MINUTES, ttp=PCF85063A.TIMER_TICK_1_OVER_60HZ
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def display_image():
|
def display_image():
|
||||||
|
|
Loading…
Reference in a new issue