1 """Support for Genius Hub binary_sensor devices."""
3 from __future__
import annotations
9 from .
import GeniusHubConfigEntry
10 from .entity
import GeniusDevice
12 GH_STATE_ATTR =
"outputOnOff"
18 entry: GeniusHubConfigEntry,
19 async_add_entities: AddEntitiesCallback,
21 """Set up the Genius Hub binary sensor entities."""
23 broker = entry.runtime_data
27 for d
in broker.client.device_objs
28 if GH_TYPE
in d.data[
"type"]
33 """Representation of a Genius Hub binary_sensor."""
35 def __init__(self, broker, device, state_attr) -> None:
36 """Initialize the binary sensor."""
41 if device.type[:21] ==
"Dual Channel Receiver":
42 self.
_attr_name_attr_name = f
"{device.type[:21]} {device.id}"
44 self.
_attr_name_attr_name = f
"{device.type} {device.id}"
48 """Return the status of the sensor."""
None __init__(self, broker, device, state_attr)
None async_setup_entry(HomeAssistant hass, GeniusHubConfigEntry entry, AddEntitiesCallback async_add_entities)