Hive Add ability to trigger the alarm (#76985)
* Add ability to trigger the alarm * Add mapping for sos state when triggered manually * Update homeassistant/components/hive/alarm_control_panel.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/hive/alarm_control_panel.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Fix linter issues Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
ed60611b07
commit
1940d9a377
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,7 @@ HIVETOHA = {
|
|||
"home": STATE_ALARM_DISARMED,
|
||||
"asleep": STATE_ALARM_ARMED_NIGHT,
|
||||
"away": STATE_ALARM_ARMED_AWAY,
|
||||
"sos": STATE_ALARM_TRIGGERED,
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,6 +50,7 @@ class HiveAlarmControlPanelEntity(HiveEntity, AlarmControlPanelEntity):
|
|||
_attr_supported_features = (
|
||||
AlarmControlPanelEntityFeature.ARM_NIGHT
|
||||
| AlarmControlPanelEntityFeature.ARM_AWAY
|
||||
| AlarmControlPanelEntityFeature.TRIGGER
|
||||
)
|
||||
|
||||
async def async_alarm_disarm(self, code: str | None = None) -> None:
|
||||
|
@ -63,6 +65,10 @@ class HiveAlarmControlPanelEntity(HiveEntity, AlarmControlPanelEntity):
|
|||
"""Send arm away command."""
|
||||
await self.hive.alarm.setMode(self.device, "away")
|
||||
|
||||
async def async_alarm_trigger(self, code=None) -> None:
|
||||
"""Send alarm trigger command."""
|
||||
await self.hive.alarm.setMode(self.device, "sos")
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Update all Node data from Hive."""
|
||||
await self.hive.session.updateData(self.device)
|
||||
|
|
Loading…
Add table
Reference in a new issue