1 """Checking binary status values from your ROMY."""
4 BinarySensorDeviceClass,
6 BinarySensorEntityDescription,
12 from .const
import DOMAIN
13 from .coordinator
import RomyVacuumCoordinator
14 from .entity
import RomyEntity
16 BINARY_SENSORS: list[BinarySensorEntityDescription] = [
19 translation_key=
"dustbin_present",
23 translation_key=
"docked",
24 device_class=BinarySensorDeviceClass.PLUG,
28 translation_key=
"water_tank_present",
29 device_class=BinarySensorDeviceClass.MOISTURE,
32 key=
"water_tank_empty",
33 translation_key=
"water_tank_empty",
34 device_class=BinarySensorDeviceClass.PROBLEM,
41 config_entry: ConfigEntry,
42 async_add_entities: AddEntitiesCallback,
44 """Set up ROMY vacuum cleaner."""
46 coordinator: RomyVacuumCoordinator = hass.data[DOMAIN][config_entry.entry_id]
50 for entity_description
in BINARY_SENSORS
51 if entity_description.key
in coordinator.romy.binary_sensors
56 """RomyBinarySensor Class."""
58 entity_description: BinarySensorEntityDescription
62 coordinator: RomyVacuumCoordinator,
63 entity_description: BinarySensorEntityDescription,
65 """Initialize the RomyBinarySensor."""
67 self.
_attr_unique_id_attr_unique_id = f
"{entity_description.key}_{self.romy.unique_id}"
72 """Return the value of the sensor."""
None __init__(self, RomyVacuumCoordinator coordinator, BinarySensorEntityDescription entity_description)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)