1 """Support for Agent DVR Alarm Control Panels."""
3 from __future__
import annotations
6 AlarmControlPanelEntity,
7 AlarmControlPanelEntityFeature,
8 AlarmControlPanelState,
14 from .
import AgentDVRConfigEntry
15 from .const
import DOMAIN
as AGENT_DOMAIN
17 CONF_HOME_MODE_NAME =
"home"
18 CONF_AWAY_MODE_NAME =
"away"
19 CONF_NIGHT_MODE_NAME =
"night"
21 CONST_ALARM_CONTROL_PANEL_NAME =
"Alarm Panel"
26 config_entry: AgentDVRConfigEntry,
27 async_add_entities: AddEntitiesCallback,
29 """Set up the Agent DVR Alarm Control Panels."""
34 """Representation of an Agent DVR Alarm Control Panel."""
36 _attr_supported_features = (
37 AlarmControlPanelEntityFeature.ARM_HOME
38 | AlarmControlPanelEntityFeature.ARM_AWAY
39 | AlarmControlPanelEntityFeature.ARM_NIGHT
41 _attr_code_arm_required =
False
42 _attr_has_entity_name =
True
46 """Initialize the alarm control panel."""
50 identifiers={(AGENT_DOMAIN, client.unique)},
51 name=f
"{client.name} {CONST_ALARM_CONTROL_PANEL_NAME}",
53 model=CONST_ALARM_CONTROL_PANEL_NAME,
54 sw_version=client.version,
58 """Update the state of the device."""
61 armed = self.
_client_client.is_armed
66 prof = (await self.
_client_client.get_active_profile()).lower()
68 if prof == CONF_HOME_MODE_NAME:
70 elif prof == CONF_NIGHT_MODE_NAME:
76 """Send disarm command."""
77 await self.
_client_client.disarm()
81 """Send arm away command. Uses custom mode."""
83 await self.
_client_client.set_active_profile(CONF_AWAY_MODE_NAME)
87 """Send arm home command. Uses custom mode."""
89 await self.
_client_client.set_active_profile(CONF_HOME_MODE_NAME)
93 """Send arm night command. Uses custom mode."""
95 await self.
_client_client.set_active_profile(CONF_NIGHT_MODE_NAME)
None async_alarm_arm_night(self, str|None code=None)
None async_alarm_arm_away(self, str|None code=None)
def __init__(self, client)
None async_alarm_arm_home(self, str|None code=None)
None async_alarm_disarm(self, str|None code=None)
None async_setup_entry(HomeAssistant hass, AgentDVRConfigEntry config_entry, AddEntitiesCallback async_add_entities)
IssData update(pyiss.ISS iss)