1 """Fully Kiosk Browser sensor."""
3 from __future__
import annotations
6 BinarySensorDeviceClass,
8 BinarySensorEntityDescription,
14 from .
import FullyKioskConfigEntry
15 from .coordinator
import FullyKioskDataUpdateCoordinator
16 from .entity
import FullyKioskEntity
18 SENSORS: tuple[BinarySensorEntityDescription, ...] = (
21 translation_key=
"kiosk_mode",
22 entity_category=EntityCategory.DIAGNOSTIC,
26 translation_key=
"plugged_in",
27 device_class=BinarySensorDeviceClass.PLUG,
28 entity_category=EntityCategory.DIAGNOSTIC,
32 translation_key=
"device_admin",
33 entity_category=EntityCategory.DIAGNOSTIC,
40 config_entry: FullyKioskConfigEntry,
41 async_add_entities: AddEntitiesCallback,
43 """Set up the Fully Kiosk Browser sensor."""
44 coordinator = config_entry.runtime_data
48 for description
in SENSORS
49 if description.key
in coordinator.data
54 """Representation of a Fully Kiosk Browser binary sensor."""
58 coordinator: FullyKioskDataUpdateCoordinator,
59 description: BinarySensorEntityDescription,
61 """Initialize the binary sensor."""
64 self.
_attr_unique_id_attr_unique_id = f
"{coordinator.data['deviceID']}-{description.key}"
68 """Return if the binary sensor is on."""
69 if (value := self.coordinator.data.get(self.
entity_descriptionentity_description.key))
is None:
None __init__(self, FullyKioskDataUpdateCoordinator coordinator, BinarySensorEntityDescription description)
None async_setup_entry(HomeAssistant hass, FullyKioskConfigEntry config_entry, AddEntitiesCallback async_add_entities)