Skip to content

Commit

Permalink
Merge pull request #195 from tijsverkoyen/hazcod
Browse files Browse the repository at this point in the history
Hazcod
  • Loading branch information
tijsverkoyen authored Dec 6, 2024
2 parents f66109b + a53f84d commit bfbd81d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions custom_components/nhc2/nhccoco/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ def _process_devices_list(self, response):
'CocoMoodbuttonPanel',
'CocoMotorcontrollerfeedbackPanel',
'CocoMotorcontrollerPanel',
'CocoMotorcontrollerSmartpanel',
'CocoMotorcontrollerx2FeedbackPanel',
'CocoMotorcontrollerx2Panel',
'CocoNhc2301RTouchswitch',
Expand All @@ -397,6 +398,7 @@ def _process_devices_list(self, response):
'CocoRolldownshutterMotor',
'CocoSocketRelay',
'CocoSunblindMotor',
'CocoSunblindSmartmotor',
'CocoSwitchedFanRelay',
'CocoSwitchedGenericRelay',
'CocoVdsVds',
Expand Down

0 comments on commit bfbd81d

Please sign in to comment.