Skip to content

Commit

Permalink
Fix Honeywell Night mode when using Instant (#156)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
ufodone committed Nov 25, 2024
1 parent ac9a218 commit 468803f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/envisalink_new/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
DEFAULT_PANIC,
DEFAULT_PARTITION_SET,
DOMAIN,
HONEYWELL_ARM_MODE_INSTANT_VALUE,
LOGGER,
)
from .helpers import find_yaml_info, generate_entity_setup_info, parse_range_string
Expand Down Expand Up @@ -160,7 +161,7 @@ def alarm_state(self) -> AlarmControlPanelState | None:

if self._info["status"]["alarm"]:
state = AlarmControlPanelState.TRIGGERED
elif self._info["status"]["armed_night"]:
elif self._is_night_mode():
state = AlarmControlPanelState.ARMED_NIGHT
elif self._info["status"]["armed_away"]:
state = AlarmControlPanelState.ARMED_AWAY
Expand Down Expand Up @@ -231,3 +232,10 @@ async def invoke_custom_function(self, pgm, code=None):
if not code:
code = self._code
await self._controller.controller.command_output(code, self._partition_number, pgm)

def _is_night_mode(self) -> bool:
if self._controller.controller.panel_type == PANEL_TYPE_HONEYWELL:
if self._arm_night_mode == HONEYWELL_ARM_MODE_INSTANT_VALUE:
return self._info["status"]["armed_zero_entry_delay"]

return self._info["status"]["armed_night"]

0 comments on commit 468803f

Please sign in to comment.