Skip to content

Persistent state_set outside of pyscript domain? #324

Answered by dlashua
selmaohneh asked this question in Q&A
Discussion options

You must be logged in to vote

It is entirely possible (i.e. Home Assistant will allow it). However, the decision was made to limit it to the "pyscript" domain. Changes need to be made here to allow it to persist in any domain.

Edit: Keep in mind, persisting sensor and binary_sensor is safe and easy since there are no service calls to be made on them. However, persisting light, for instance, is problematic with a change like this. While the state updates will work, this will not handle service calls (i.e. light.turn_on). So the light entity it creates will not response to UI button presses, etc. The proper implementation for light, switch, climate, etc is to implement the Home Assistant setup methods for each of those …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@selmaohneh
Comment options

@selmaohneh
Comment options

Answer selected by selmaohneh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants