1 """Support for Lupusec System alarm control panels."""
3 from __future__
import annotations
5 from datetime
import timedelta
10 AlarmControlPanelEntity,
11 AlarmControlPanelEntityFeature,
12 AlarmControlPanelState,
20 from .entity
import LupusecDevice
27 config_entry: ConfigEntry,
28 async_add_entities: AddEntitiesCallback,
30 """Set up an alarm control panel for a Lupusec device."""
31 data = hass.data[DOMAIN][config_entry.entry_id]
33 alarm = await hass.async_add_executor_job(data.get_alarm)
39 """An alarm_control_panel implementation for Lupusec."""
42 _attr_supported_features = (
43 AlarmControlPanelEntityFeature.ARM_HOME
44 | AlarmControlPanelEntityFeature.ARM_AWAY
46 _attr_code_arm_required =
False
49 self, data: lupupy.Lupusec, device: lupupy.devices.LupusecAlarm, entry_id: str
51 """Initialize the LupusecAlarm class."""
55 identifiers={(DOMAIN, entry_id)},
57 manufacturer=
"Lupus Electronics",
58 model=f
"Lupusec-XT{data.model}",
63 """Return the state of the device."""
64 if self.
_device_device.is_standby:
65 state = AlarmControlPanelState.DISARMED
66 elif self.
_device_device.is_away:
67 state = AlarmControlPanelState.ARMED_AWAY
68 elif self.
_device_device.is_home:
69 state = AlarmControlPanelState.ARMED_HOME
70 elif self.
_device_device.is_alarm_triggered:
71 state = AlarmControlPanelState.TRIGGERED
77 """Send arm away command."""
81 """Send disarm command."""
82 self.
_device_device.set_standby()
85 """Send arm home command."""
None alarm_arm_home(self, str|None code=None)
AlarmControlPanelState|None alarm_state(self)
None alarm_disarm(self, str|None code=None)
None __init__(self, lupupy.Lupusec data, lupupy.devices.LupusecAlarm device, str entry_id)
None alarm_arm_away(self, str|None code=None)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)