1 """Support for wired binary sensors attached to a Konnected device."""
18 from .const
import DOMAIN
as KONNECTED_DOMAIN
23 config_entry: ConfigEntry,
24 async_add_entities: AddEntitiesCallback,
26 """Set up binary sensors attached to a Konnected device from a config entry."""
27 data = hass.data[KONNECTED_DOMAIN]
28 device_id = config_entry.data[
"id"]
31 for pin_num, pin_data
in data[CONF_DEVICES][device_id][
39 """Representation of a Konnected binary sensor."""
41 _attr_should_poll =
False
44 """Initialize the Konnected binary sensor."""
51 identifiers={(KONNECTED_DOMAIN, device_id)},
55 """Store entity_id and register state change callback."""
65 """Update the sensor's state."""
None async_added_to_hass(self)
def __init__(self, device_id, zone_num, data)
def async_set_state(self, state)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)