1 """Support for Satel Integra zone states- represented as binary sensors."""
3 from __future__
import annotations
6 BinarySensorDeviceClass,
20 SIGNAL_OUTPUTS_UPDATED,
28 async_add_entities: AddEntitiesCallback,
29 discovery_info: DiscoveryInfoType |
None =
None,
31 """Set up the Satel Integra binary sensor devices."""
32 if not discovery_info:
35 configured_zones = discovery_info[CONF_ZONES]
36 controller = hass.data[DATA_SATEL]
40 for zone_num, device_config_data
in configured_zones.items():
41 zone_type = device_config_data[CONF_ZONE_TYPE]
42 zone_name = device_config_data[CONF_ZONE_NAME]
44 controller, zone_num, zone_name, zone_type, CONF_ZONES, SIGNAL_ZONES_UPDATED
46 devices.append(device)
48 configured_outputs = discovery_info[CONF_OUTPUTS]
50 for zone_num, device_config_data
in configured_outputs.items():
51 zone_type = device_config_data[CONF_ZONE_TYPE]
52 zone_name = device_config_data[CONF_ZONE_NAME]
59 SIGNAL_OUTPUTS_UPDATED,
61 devices.append(device)
67 """Representation of an Satel Integra binary sensor."""
69 _attr_should_poll =
False
80 """Initialize the binary_sensor."""
90 """Register callbacks."""
108 """Return the name of the entity."""
109 return self.
_name_name
113 """Icon for device by its type."""
114 if self.
_zone_type_zone_type
is BinarySensorDeviceClass.SMOKE:
120 """Return true if sensor is on."""
121 return self.
_state_state == 1
125 """Return the class of this sensor, from DEVICE_CLASSES."""
130 """Update the zone's state, if needed."""
def _devices_updated(self, zones)
def __init__(self, controller, device_number, device_name, zone_type, sensor_type, react_to_signal)
None async_added_to_hass(self)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)