1 """Support for Abode Security System entities."""
3 from jaraco.abode.automation
import Automation
as AbodeAuto
4 from jaraco.abode.devices.base
import Device
as AbodeDev
9 from .
import AbodeSystem
10 from .const
import ATTRIBUTION, DOMAIN
14 """Representation of an Abode entity."""
16 _attr_attribution = ATTRIBUTION
17 _attr_has_entity_name =
True
20 """Initialize Abode entity."""
25 """Subscribe to Abode connection status updates."""
26 await self.
hasshass.async_add_executor_job(
27 self.
_data_data.abode.events.add_connection_status_callback,
32 self.
hasshass.data[DOMAIN].entity_ids.add(self.
entity_identity_id)
35 """Unsubscribe from Abode connection status updates."""
36 await self.
hasshass.async_add_executor_job(
37 self.
_data_data.abode.events.remove_connection_status_callback, self.
unique_idunique_id
41 """Update the entity available property."""
47 """Representation of an Abode device."""
49 def __init__(self, data: AbodeSystem, device: AbodeDev) ->
None:
50 """Initialize Abode device."""
56 """Subscribe to device events."""
58 await self.
hasshass.async_add_executor_job(
59 self.
_data_data.abode.events.add_device_callback,
65 """Unsubscribe from device events."""
67 await self.
hasshass.async_add_executor_job(
68 self.
_data_data.abode.events.remove_all_device_callbacks, self.
_device_device.id
72 """Update device state."""
77 """Return the state attributes."""
79 "device_id": self.
_device_device.id,
80 "battery_low": self.
_device_device.battery_low,
81 "no_response": self.
_device_device.no_response,
82 "device_type": self.
_device_device.type,
87 """Return device registry information for this entity."""
89 identifiers={(DOMAIN, self.
_device_device.id)},
96 """Update the device state."""
101 """Representation of an Abode automation."""
103 def __init__(self, data: AbodeSystem, automation: AbodeAuto) ->
None:
104 """Initialize for Abode automation."""
110 "type":
"CUE automation",
114 """Update automation state."""
_attr_extra_state_attributes
None __init__(self, AbodeSystem data, AbodeAuto automation)
None async_will_remove_from_hass(self)
None _update_callback(self, AbodeDev device)
None async_added_to_hass(self)
DeviceInfo device_info(self)
dict[str, str] extra_state_attributes(self)
None __init__(self, AbodeSystem data, AbodeDev device)
None async_will_remove_from_hass(self)
None _update_connection_status(self)
None async_added_to_hass(self)
None __init__(self, AbodeSystem data)
None schedule_update_ha_state(self, bool force_refresh=False)