@@ -82,12 +82,12 @@ def _check_code(code: Optional[str]) -> Optional[str]:
8282 @property
8383 def supported_features (self ) -> int :
8484 if self ._cu .mode == JA80CentralUnit .SYSTEM_MODE_UNSPLIT :
85- return SUPPORT_ALARM_ARM_AWAY
85+ return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_TRIGGER
8686 elif self ._cu .mode == JA80CentralUnit .SYSTEM_MODE_PARTIAL :
87- return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_NIGHT
87+ return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_NIGHT | SUPPORT_ALARM_TRIGGER
8888 elif self ._cu .mode == JA80CentralUnit .SYSTEM_MODE_SPLIT :
89- return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_HOME
90- return SUPPORT_ALARM_ARM_AWAY
89+ return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_TRIGGER
90+ return SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_TRIGGER
9191
9292 @property
9393 def code_arm_required (self ) -> bool :
@@ -161,8 +161,11 @@ async def async_alarm_arm_night(self, code=None) -> None:
161161 if self ._cu .mode == JA80CentralUnit .SYSTEM_MODE_PARTIAL :
162162 self ._cu .arm (code ,"B" )
163163
164- async def async_alarm_trigger (self , code = None ) -> None :
165- raise NotImplementedError ()
164+ async def async_alarm_trigger (self , code = None ) -> None :
165+ if self .state == STATE_ALARM_DISARMED :
166+ self ._cu .send_keypress_sequence ("*7" + self ._cu ._master_code , b'\xa1 ' )
167+ else :
168+ self ._cu .send_keypress_sequence ("*7" + self ._cu ._master_code , b'\xa2 ' )
166169
167170 async def async_alarm_arm_custom_bypass (self , code = None ) -> None :
168171 raise NotImplementedError ()
@@ -294,4 +297,4 @@ async def async_added_to_hass(self) -> None:
294297 async def async_will_remove_from_hass (self ) -> None :
295298 """Entity being removed from hass."""
296299 for zone in self ._zones :
297- zone .remove_callback (self .async_write_ha_state )
300+ zone .remove_callback (self .async_write_ha_state )
0 commit comments