Skip to content

Commit

Permalink
add triggered state
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmadigan committed Sep 18, 2024
1 parent dc869dc commit 0abe7a6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion custom_components/hkc_alarm/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,17 @@ def _handle_coordinator_update(self) -> None:
self._panel_data = panel_data
blocks = status.get("blocks", [])

if any(block["armState"] == 3 for block in blocks):
if any(block["inAlarm"] for block in blocks):
self._state = "triggered"
elif any(block["armState"] == 3 for block in blocks):
self._state = "armed_away"
elif any(block["armState"] == 2 for block in blocks):
self._state = "armed_night"
elif any(block["armState"] == 1 for block in blocks):
self._state = "armed_home"
else:
self._state = "disarmed"

self.async_write_ha_state() # Update the state with the latest data


Expand Down
2 changes: 1 addition & 1 deletion custom_components/hkc_alarm/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "hkc_alarm",
"name": "HKC Alarm",
"version": "1.0.13",
"version": "1.0.19",
"documentation": "https://github.com/jasonmadigan/ha-hkc",
"issue_tracker": "https://github.com/jasonmadigan/ha-hkc/issues",
"dependencies": [],
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HKC Alarm Integration for Home Assistant",
"hacs": "1.0.16",
"hacs": "1.0.19",
"render_readme": true,
"homeassistant": "2024.6.4"
}

0 comments on commit 0abe7a6

Please sign in to comment.