1 """Binary sensor platform support for wiffi devices."""
9 from .const
import CREATE_ENTITY_SIGNAL
10 from .entity
import WiffiEntity
15 config_entry: ConfigEntry,
16 async_add_entities: AddEntitiesCallback,
18 """Set up platform for a new integration.
20 Called by the HA framework after async_forward_entry_setups has been called
21 during initialization of a new integration (= wiffi).
25 def _create_entity(device, metric):
26 """Create platform specific entities."""
30 entities.append(
BoolEntity(device, metric, config_entry.options))
38 """Entity for wiffi metrics which have a boolean value."""
41 """Initialize the entity."""
42 super().
__init__(device, metric, options)
48 """Return true if value is valid."""
53 """Update the value of the entity.
55 Called if a new message has been received from the wiffi device.
def _update_value_callback(self, device, metric)
def __init__(self, device, metric, options)
def reset_expiration_date(self)
None async_write_ha_state(self)
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)