@@ -36,6 +36,19 @@ async def test_zone_events_update_zone_state(
3636 assert alarm .zones [2 ].triggered is False
3737
3838
39+ @pytest .mark .asyncio
40+ async def test_zone_23_events_update_zone_state (
41+ client : Client , connection : Connection , alarm : Alarm
42+ ) -> None :
43+ # Zone 23 unsealed at 23:45 on 10/5/2008
44+ await _feed_ascii (client , connection , "87020361002301080510234500E3" )
45+ assert alarm .zones [22 ].triggered is True
46+
47+ # Zone 23 sealed one minute later
48+ await _feed_ascii (client , connection , "87020361012301080510234600E1" )
49+ assert alarm .zones [22 ].triggered is False
50+
51+
3952@pytest .mark .asyncio
4053async def test_arming_events_update_alarm_state (
4154 client : Client , connection : Connection , alarm : Alarm
@@ -49,6 +62,36 @@ async def test_arming_events_update_alarm_state(
4962 assert alarm .arming_state == ArmingState .DISARMED
5063
5164
65+ @pytest .mark .asyncio
66+ async def test_armed_vacation_event_updates_alarm_state (
67+ client : Client , connection : Connection , alarm : Alarm
68+ ) -> None :
69+ callback = Mock ()
70+ client .on_state_change (callback )
71+
72+ await _feed_ascii (client , connection , "87020361280101080510234500DD" )
73+ assert alarm ._arming_mode == ArmingMode .ARMED_VACATION
74+
75+ assert callback .call_args_list == [
76+ call (ArmingState .ARMING , ArmingMode .ARMED_VACATION ),
77+ ]
78+
79+
80+ @pytest .mark .asyncio
81+ async def test_armed_highest_event_updates_alarm_state (
82+ client : Client , connection : Connection , alarm : Alarm
83+ ) -> None :
84+ callback = Mock ()
85+ client .on_state_change (callback )
86+
87+ await _feed_ascii (client , connection , "870203612E0101080510234500D0" )
88+ assert alarm ._arming_mode == ArmingMode .ARMED_HIGHEST
89+
90+ assert callback .call_args_list == [
91+ call (ArmingState .ARMING , ArmingMode .ARMED_HIGHEST ),
92+ ]
93+
94+
5295@pytest .mark .asyncio
5396async def test_arm_away_emits_ascii_payload (
5497 client : Client , connection : Connection
0 commit comments