Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Restore manual alarm-control-panel state using async_get_last_state #17521
This small change restores the manual alarm control panel component's state should homeassistant be restarted for whatever reason. The change uses async_get_last_state as used by components like input-boolean etc.
Related issue (if applicable): fixes #10793
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#N/A
Example entry for
Oct 16, 2018
This fix will restore the last state logged that was logged by the logger component whenever hass restarts. This would solve the related issue but I'm just wondering if the right thing might not be to also add an initial state configuration option that would overwrite this behaviour. I could add this as well but I honestly can't think of a use case where restoring the last state would not be what you want. As is, this fix is definitely better than the current implementation where the state is hard-coded to be initialised to Disarmed.
As a personal sufferer of this issue, I would certainly be happy with this fix as is. What do you guys think?
referenced this pull request
Oct 21, 2018
Oct 25, 2018
@liaanvdm I know this has been merged but I am wondering if this would be the same fix for when you use alarm control panel with IFTTT. Upon a restart, the state shows "unknown" until you set it again.
I don't know async so I am not sure.