You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Input numbers and booleans (toggles made in HA "helpers" menu) modified by Pyscript do not trigger the state triggers that are listening to them.
For example, nothing is logged when the below is ran even though HA updates the GUI and fires the state_changed events as expected.
@state_trigger("input_number.tv_brightness")deftv_brightness_set(value=None):
log.warning(f"TV brightness set to {value}")
input_number.set_value(entity_id="input_number.tv_brightness", value=75)
task.sleep(3)
input_number.set_value(entity_id="input_number.tv_brightness", value=50)
state.set("input_number.tv_brightness", 25)
@state_trigger("input_boolean.dev_bool")defdev_bool(value=None):
log.warning(f"dev_bool set to {value}")
input_boolean.toggle(entity_id="input_boolean.dev_bool")
The text was updated successfully, but these errors were encountered:
After digging deeper, it seems this is limited to reloading (saving the .py file) and calling the changes bare. The changes probalby trigger before the decorators have had time to setup so they're not caught. This seems like such an edge case i'll close the issue.
I was also calling input_number changes wrong in some of my files which made me think this was an issue. state.set("input_number.somenumber", 25) is the wrong way to call it as it only updaes the GUI. People should use input_number.set_value(entity_id="something", value=25) instead
Input numbers and booleans (toggles made in HA "helpers" menu) modified by Pyscript do not trigger the state triggers that are listening to them.
For example, nothing is logged when the below is ran even though HA updates the GUI and fires the state_changed events as expected.
The text was updated successfully, but these errors were encountered: