hass-aarlo icon indicating copy to clipboard operation
hass-aarlo copied to clipboard

aarlo.alarm_set_mode is broken

Open modestpharaoh opened this issue 2 years ago • 2 comments

aarlo.alarm_set_mode is silently has no effect, as you imported two different DOMAIN (s) , where the 1st DOMAIN is the intended on as ALARM_DOMAIN and 2nd DOMAIN as aarlo is the one the has effect in alarm_mode_service function

from homeassistant.components.alarm_control_panel import (
    DOMAIN,
    FORMAT_NUMBER,
    FORMAT_TEXT,
    AlarmControlPanelEntity,
)
.
.
.
from .const import (
    COMPONENT_ATTRIBUTION,
    COMPONENT_BRAND,
    COMPONENT_CONFIG,
    COMPONENT_DATA,
    COMPONENT_DOMAIN,
    COMPONENT_SERVICES,
    DOMAIN,
)
.
.
def alarm_mode_service(hass, call):
    for entity_id in call.data["entity_id"]:
        try:
            mode = call.data["mode"]
            get_entity_from_domain(hass, DOMAIN, entity_id).set_mode_in_ha(mode)
            _LOGGER.info("{0} setting mode to {1}".format(entity_id, mode))
        except HomeAssistantError:
            _LOGGER.warning("{0} is not an aarlo alarm device".format(entity_id))

modestpharaoh avatar Apr 01 '22 08:04 modestpharaoh

I also have this problem. Is there any way I can import this fix?

suneworld avatar Apr 29 '22 20:04 suneworld

You can probably install from the pull request: https://github.com/twrecked/hass-aarlo/pull/582

danielsvane avatar May 09 '22 19:05 danielsvane