Send status updae after doing changes
This commit is contained in:
@@ -84,14 +84,7 @@ def cooking_state_temperature_provider():
|
|||||||
|
|
||||||
def cooking_state_on_state_change(state):
|
def cooking_state_on_state_change(state):
|
||||||
print(f"[Main] Cooking state changed to: {state.state}")
|
print(f"[Main] Cooking state changed to: {state.state}")
|
||||||
|
|
||||||
# Send to the Wifi board the current state
|
|
||||||
uart_device.send_as_command(UARTCommand(UARTCommandType.COOKING_STATE_UPDATE, {"state": state.state}))
|
|
||||||
# Send to the orchestrator the current state
|
|
||||||
lora.send_reliable({"id": DEVICE_ID, "new_cooking_state": state.state})
|
|
||||||
|
|
||||||
display.text(cookingState.CookingStates.get_state_name(state.state), 1, 2, 1)
|
|
||||||
display.show()
|
|
||||||
|
|
||||||
if state.paused or state.state == cookingState.CookingStates.DONE or state.state == cookingState.CookingStates.IDLE:
|
if state.paused or state.state == cookingState.CookingStates.DONE or state.state == cookingState.CookingStates.IDLE:
|
||||||
magnetron_led.off()
|
magnetron_led.off()
|
||||||
@@ -108,6 +101,15 @@ def cooking_state_on_state_change(state):
|
|||||||
if state.state == cookingState.CookingStates.ALERT:
|
if state.state == cookingState.CookingStates.ALERT:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Send to the Wifi board the current state
|
||||||
|
uart_device.send_as_command(UARTCommand(UARTCommandType.COOKING_STATE_UPDATE, {"state": state.state}))
|
||||||
|
# Send to the orchestrator the current state
|
||||||
|
lora.send_reliable({"id": DEVICE_ID, "new_cooking_state": state.state})
|
||||||
|
|
||||||
|
display.fill(0)
|
||||||
|
display.text(cookingState.CookingStates.get_state_name(state.state), 1, 2, 1)
|
||||||
|
display.show()
|
||||||
|
|
||||||
def cooking_state_on_refresh(state):
|
def cooking_state_on_refresh(state):
|
||||||
# TODO Show screen information
|
# TODO Show screen information
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user