1 """Support for Abode Security System switches."""
3 from __future__
import annotations
5 from typing
import Any, cast
7 from jaraco.abode.devices.switch
import Switch
15 from .
import AbodeSystem
16 from .const
import DOMAIN
17 from .entity
import AbodeAutomation, AbodeDevice
19 DEVICE_TYPES = [
"switch",
"valve"]
23 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
25 """Set up Abode switch devices."""
26 data: AbodeSystem = hass.data[DOMAIN]
28 entities: list[SwitchEntity] = [
30 for device_type
in DEVICE_TYPES
31 for device
in data.abode.get_devices(generic_type=device_type)
36 for automation
in data.abode.get_automations()
43 """Representation of an Abode switch."""
49 """Turn on the device."""
53 """Turn off the device."""
54 self.
_device_device.switch_off()
58 """Return true if device is on."""
59 return cast(bool, self.
_device_device.is_on)
63 """A switch implementation for Abode automations."""
65 _attr_translation_key =
"automation"
68 """Set up trigger automation service."""
71 signal = f
"abode_trigger_automation_{self.entity_id}"
75 """Enable the automation."""
80 """Disable the automation."""
85 """Trigger the automation."""
90 """Return True if the automation is enabled."""
None turn_on(self, **Any kwargs)
None async_added_to_hass(self)
None turn_off(self, **Any kwargs)
None turn_on(self, **Any kwargs)
None turn_off(self, **Any kwargs)
None async_on_remove(self, CALLBACK_TYPE func)
None schedule_update_ha_state(self, bool force_refresh=False)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)