1 """Binary sensors on Zigbee Home Automation networks."""
3 from __future__
import annotations
8 BinarySensorDeviceClass,
17 from .entity
import ZHAEntity
18 from .helpers
import (
21 async_add_entities
as zha_async_add_entities,
28 config_entry: ConfigEntry,
29 async_add_entities: AddEntitiesCallback,
31 """Set up the Zigbee Home Automation binary sensor from config entry."""
33 entities_to_create = zha_data.platforms[Platform.BINARY_SENSOR]
39 zha_async_add_entities, async_add_entities, BinarySensor, entities_to_create
42 config_entry.async_on_unload(unsub)
46 """ZHA BinarySensor."""
48 def __init__(self, entity_data: EntityData) ->
None:
49 """Initialize the ZHA binary sensor."""
51 if self.entity_data.entity.info_object.device_class
is not None:
53 self.entity_data.entity.info_object.device_class
58 """Return True if the switch is on based on the state machine."""
59 return self.entity_data.entity.is_on
None __init__(self, EntityData entity_data)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
HAZHAData get_zha_data(HomeAssistant hass)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)