1 """Binary Sensor platform for CoolMasterNet integration."""
3 from __future__
import annotations
6 BinarySensorDeviceClass,
8 BinarySensorEntityDescription,
15 from .const
import DATA_COORDINATOR, DATA_INFO, DOMAIN
16 from .entity
import CoolmasterEntity
21 config_entry: ConfigEntry,
22 async_add_entities: AddEntitiesCallback,
24 """Set up the CoolMasterNet binary_sensor platform."""
25 info = hass.data[DOMAIN][config_entry.entry_id][DATA_INFO]
26 coordinator = hass.data[DOMAIN][config_entry.entry_id][DATA_COORDINATOR]
29 for unit_id
in coordinator.data
34 """Representation of a unit's filter state (true means need to be cleaned)."""
38 translation_key=
"clean_filter",
39 device_class=BinarySensorDeviceClass.PROBLEM,
40 entity_category=EntityCategory.DIAGNOSTIC,
45 """Return true if the binary sensor is on."""
46 return self.
_unit_unit.clean_filter
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)