1 """Support for the Hive alarm."""
3 from __future__
import annotations
5 from datetime
import timedelta
8 AlarmControlPanelEntity,
9 AlarmControlPanelEntityFeature,
10 AlarmControlPanelState,
16 from .const
import DOMAIN
17 from .entity
import HiveEntity
22 "home": AlarmControlPanelState.DISARMED,
23 "asleep": AlarmControlPanelState.ARMED_NIGHT,
24 "away": AlarmControlPanelState.ARMED_AWAY,
25 "sos": AlarmControlPanelState.TRIGGERED,
30 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
32 """Set up Hive thermostat based on a config entry."""
34 hive = hass.data[DOMAIN][entry.entry_id]
35 if devices := hive.session.deviceList.get(
"alarm_control_panel"):
42 """Representation of a Hive alarm."""
44 _attr_supported_features = (
45 AlarmControlPanelEntityFeature.ARM_NIGHT
46 | AlarmControlPanelEntityFeature.ARM_AWAY
47 | AlarmControlPanelEntityFeature.TRIGGER
49 _attr_code_arm_required =
False
52 """Send disarm command."""
56 """Send arm night command."""
60 """Send arm away command."""
64 """Send alarm trigger command."""
68 """Update all Node data from Hive."""
None async_alarm_disarm(self, str|None code=None)
None async_alarm_arm_away(self, str|None code=None)
None async_alarm_arm_night(self, str|None code=None)
None async_alarm_trigger(self, str|None code=None)
web.Response get(self, web.Request request, str config_key)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)