From cc6a129ad2f76d45380cbe23614257426c10360d Mon Sep 17 00:00:00 2001 From: Tijs Verkoyen Date: Fri, 6 Dec 2024 13:58:07 +0100 Subject: [PATCH 1/3] Ignore CocoMotorcontrollerSmartpanel as it has no properties --- custom_components/nhc2/nhccoco/coco.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/nhc2/nhccoco/coco.py b/custom_components/nhc2/nhccoco/coco.py index 0c42c6d..a9f6d13 100755 --- a/custom_components/nhc2/nhccoco/coco.py +++ b/custom_components/nhc2/nhccoco/coco.py @@ -372,6 +372,7 @@ def _process_devices_list(self, response): 'CocoMoodbuttonPanel', 'CocoMotorcontrollerfeedbackPanel', 'CocoMotorcontrollerPanel', + 'CocoMotorcontrollerSmartpanel', 'CocoMotorcontrollerx2FeedbackPanel', 'CocoMotorcontrollerx2Panel', 'CocoNhc2301RTouchswitch', From 318a1158db17ce6e84d966f50f59d8beca771c4b Mon Sep 17 00:00:00 2001 From: Tijs Verkoyen Date: Fri, 6 Dec 2024 13:58:37 +0100 Subject: [PATCH 2/3] Ignore CocoSunblindSmartmotor as it has no properties --- custom_components/nhc2/nhccoco/coco.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/nhc2/nhccoco/coco.py b/custom_components/nhc2/nhccoco/coco.py index a9f6d13..7744e68 100755 --- a/custom_components/nhc2/nhccoco/coco.py +++ b/custom_components/nhc2/nhccoco/coco.py @@ -398,6 +398,7 @@ def _process_devices_list(self, response): 'CocoRolldownshutterMotor', 'CocoSocketRelay', 'CocoSunblindMotor', + 'CocoSunblindSmartmotor', 'CocoSwitchedFanRelay', 'CocoSwitchedGenericRelay', 'CocoVdsVds', From a53f84d461942506800354e18a839487a10e4d7e Mon Sep 17 00:00:00 2001 From: Tijs Verkoyen Date: Fri, 6 Dec 2024 14:01:39 +0100 Subject: [PATCH 3/3] Use AlarmControlPanelState instead of the STATE_ALARM_* constants --- .../nhc2/entities/alarms_action_alarm_control_panel.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/nhc2/entities/alarms_action_alarm_control_panel.py b/custom_components/nhc2/entities/alarms_action_alarm_control_panel.py index 2ce92da..8a38bb5 100644 --- a/custom_components/nhc2/entities/alarms_action_alarm_control_panel.py +++ b/custom_components/nhc2/entities/alarms_action_alarm_control_panel.py @@ -1,5 +1,5 @@ -from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity, AlarmControlPanelEntityFeature -from homeassistant.const import STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMING +from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity, AlarmControlPanelEntityFeature, \ + AlarmControlPanelState from ..nhccoco.devices.alarms_action import CocoAlarmsAction from .nhc_entity import NHCBaseEntity @@ -21,11 +21,11 @@ def __init__(self, device_instance: CocoAlarmsAction, hub, gateway): @property def state(self) -> str: if self._device.is_basic_state_off: - return STATE_ALARM_DISARMED + return AlarmControlPanelState.DISARMED if self._device.is_basic_state_on: - return STATE_ALARM_ARMED_AWAY + return AlarmControlPanelState.ARMED_AWAY if self._device.is_basic_state_intermediate: - return STATE_ALARM_ARMING + return AlarmControlPanelState.ARMING async def async_alarm_arm_away(self, code=None) -> None: self._device.arm(self._gateway)