Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set initial_state dynamically #7

Open
muxa opened this issue Aug 30, 2021 · 2 comments
Open

Ability to set initial_state dynamically #7

muxa opened this issue Aug 30, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@muxa
Copy link
Owner

muxa commented Aug 30, 2021

When controlling, for instance, light wit a state machine, the light state will be restored from HA, but the state machine won't be.
We need a way to restore state machine initial state somehow.

@muxa muxa added duplicate This issue or pull request already exists enhancement New feature or request and removed duplicate This issue or pull request already exists labels Aug 30, 2021
@muxa
Copy link
Owner Author

muxa commented Sep 24, 2021

Looks like this can be achieved by making initial_state templatable.

@majkrzak
Copy link

It can also be perserved in the rtc memory, like in light component for example: https://github.com/esphome/esphome/blob/6919930aaa230f0437d0975d902e98cc7dbbf11f/esphome/components/light/light_state.cpp#L59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants