Closed wisemanny closed 8 months ago
I made a dirty fix and it seems to be working, will test it more, I did not do PR because I changed the files and it is not a part of git repo here is the updated function:
@property
def state(self) -> str:
"""Return current state."""
curr_state = int(self._alarm_panel_attribute.current_value)
if curr_state == 0:
return "armed_home"
elif curr_state == 1:
return "armed_night"
elif curr_state == 2:
return "armed_away"
elif curr_state == 3:
return "armed_vacation"
else:
return None
I opened a PR and added one more fix - support for motion sensors.
fixed with #49 THX for your contribution!
Type of problem
Version
2.8.0
Detailed description
If I use Homee state (Home/Away) in an automation as condition, it always resolves to test failed. I.e. condition never passes. If Homee is set to Home and I test for Home, it will not pass.
Error log
I think the problem is that HA docs require the state to be str: https://developers.home-assistant.io/docs/core/entity/alarm-control-panel/ state | str \ None | Required | One of the states listed in the states.
But in the code, I see that return type of the state is int: https://github.com/Taraman17/hass-homee/blob/809bdcf3bfe9d74f55cd4004ab8d3a3ba6e0a6bf/custom_components/homee/alarm_control_panel.py#L83