1 """BleBox binary sensor entities."""
3 from blebox_uniapi.binary_sensor
import BinarySensor
as BinarySensorFeature
6 BinarySensorDeviceClass,
8 BinarySensorEntityDescription,
13 from .
import BleBoxConfigEntry
14 from .entity
import BleBoxEntity
16 BINARY_SENSOR_TYPES = (
19 device_class=BinarySensorDeviceClass.MOISTURE,
26 config_entry: BleBoxConfigEntry,
27 async_add_entities: AddEntitiesCallback,
29 """Set up a BleBox entry."""
32 for feature
in config_entry.runtime_data.features.get(
"binary_sensors", [])
33 for description
in BINARY_SENSOR_TYPES
34 if description.key == feature.device_class
40 """Representation of a BleBox binary sensor feature."""
43 self, feature: BinarySensorFeature, description: BinarySensorEntityDescription
45 """Initialize a BleBox binary sensor feature."""
51 """Return the state."""
52 return self._feature.state
None __init__(self, BinarySensorFeature feature, BinarySensorEntityDescription description)
None async_setup_entry(HomeAssistant hass, BleBoxConfigEntry config_entry, AddEntitiesCallback async_add_entities)