1 """Binary sensor support for the Skybell HD Doorbell."""
3 from __future__
import annotations
5 from aioskybell.helpers
import const
as CONST
8 BinarySensorDeviceClass,
10 BinarySensorEntityDescription,
17 from .coordinator
import SkybellDataUpdateCoordinator
18 from .entity
import SkybellEntity
20 BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
23 translation_key=
"button",
24 device_class=BinarySensorDeviceClass.OCCUPANCY,
28 device_class=BinarySensorDeviceClass.MOTION,
34 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
36 """Set up Skybell binary sensor."""
39 for sensor
in BINARY_SENSOR_TYPES
40 for coordinator
in hass.data[DOMAIN][entry.entry_id]
45 """A binary sensor implementation for Skybell devices."""
49 coordinator: SkybellDataUpdateCoordinator,
50 description: BinarySensorEntityDescription,
52 """Initialize a binary sensor for a Skybell device."""
53 super().
__init__(coordinator, description)
54 self.
_event_event: dict[str, str] = {}
58 """Handle updated data from the coordinator."""
None _handle_coordinator_update(self)
None __init__(self, SkybellDataUpdateCoordinator coordinator, BinarySensorEntityDescription description)
SkybellDevice _device(self)
web.Response get(self, web.Request request, str config_key)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)