1 """Support for Abode Security System binary sensors."""
3 from __future__
import annotations
5 from typing
import cast
7 from jaraco.abode.devices.binary_sensor
import BinarySensor
10 BinarySensorDeviceClass,
18 from .
import AbodeSystem
19 from .const
import DOMAIN
20 from .entity
import AbodeDevice
24 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
26 """Set up Abode binary sensor devices."""
27 data: AbodeSystem = hass.data[DOMAIN]
39 for device
in data.abode.get_devices(generic_type=device_types)
44 """A binary sensor implementation for Abode device."""
51 """Return True if the binary sensor is on."""
52 return cast(bool, self.
_device_device.is_on)
56 """Return the class of the binary sensor."""
58 return BinarySensorDeviceClass.WINDOW
59 return try_parse_enum(BinarySensorDeviceClass, self.
_device_device.generic_type)
BinarySensorDeviceClass|None device_class(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
float|int|str|None get_value(Sensor sensor, str field)