Skip to content

Commit 468803f

Browse files
committed
Fix Honeywell Night mode when using Instant (#156)
Fixed knock on from previous changes to Night mode handling. If a Honeywell system was configured to use `Instant` for night mode then the alarm panel would incorrectly show `Armed Home` instead of `Armed Night`.
1 parent ac9a218 commit 468803f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

custom_components/envisalink_new/alarm_control_panel.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
DEFAULT_PANIC,
2626
DEFAULT_PARTITION_SET,
2727
DOMAIN,
28+
HONEYWELL_ARM_MODE_INSTANT_VALUE,
2829
LOGGER,
2930
)
3031
from .helpers import find_yaml_info, generate_entity_setup_info, parse_range_string
@@ -160,7 +161,7 @@ def alarm_state(self) -> AlarmControlPanelState | None:
160161

161162
if self._info["status"]["alarm"]:
162163
state = AlarmControlPanelState.TRIGGERED
163-
elif self._info["status"]["armed_night"]:
164+
elif self._is_night_mode():
164165
state = AlarmControlPanelState.ARMED_NIGHT
165166
elif self._info["status"]["armed_away"]:
166167
state = AlarmControlPanelState.ARMED_AWAY
@@ -231,3 +232,10 @@ async def invoke_custom_function(self, pgm, code=None):
231232
if not code:
232233
code = self._code
233234
await self._controller.controller.command_output(code, self._partition_number, pgm)
235+
236+
def _is_night_mode(self) -> bool:
237+
if self._controller.controller.panel_type == PANEL_TYPE_HONEYWELL:
238+
if self._arm_night_mode == HONEYWELL_ARM_MODE_INSTANT_VALUE:
239+
return self._info["status"]["armed_zero_entry_delay"]
240+
241+
return self._info["status"]["armed_night"]

0 commit comments

Comments
 (0)