1 """Support for Oncue binary sensors."""
3 from __future__
import annotations
6 BinarySensorDeviceClass,
8 BinarySensorEntityDescription,
14 from .entity
import OncueEntity
15 from .types
import OncueConfigEntry
17 SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
19 key=
"NetworkConnectionEstablished",
20 entity_category=EntityCategory.DIAGNOSTIC,
21 device_class=BinarySensorDeviceClass.CONNECTIVITY,
25 SENSOR_MAP = {description.key: description
for description
in SENSOR_TYPES}
30 config_entry: OncueConfigEntry,
31 async_add_entities: AddEntitiesCallback,
33 """Set up binary sensors."""
34 coordinator = config_entry.runtime_data
35 devices = coordinator.data
38 for device_id, device
in devices.items()
39 for key, sensor
in device.sensors.items()
45 """Representation of an Oncue binary sensor."""
49 """Return the binary sensor state."""
None async_setup_entry(HomeAssistant hass, OncueConfigEntry config_entry, AddEntitiesCallback async_add_entities)