1 """Broadlink entities."""
7 from .const
import DOMAIN
11 """Representation of a Broadlink entity."""
13 _attr_should_poll =
False
16 """Initialize the entity."""
21 """Call when the entity is added to hass."""
27 """Update the state of the entity."""
28 await self.
_coordinator_coordinator.async_request_refresh()
31 """Receive data from the update coordinator.
33 This event listener should be called by the coordinator whenever
34 there is an update available.
36 It works as a template for the _update_state() method, which should
37 be overridden by child classes in order to update the state of the
38 entities, when applicable.
45 """Update the state of the entity.
47 This method should be overridden by child classes in order to
48 internalize state and attributes received from the coordinator.
53 """Return True if the entity is available."""
54 return self.
_device_device.available
58 """Return device info."""
62 connections={(dr.CONNECTION_NETWORK_MAC, device.mac_address)},
63 identifiers={(DOMAIN, device.unique_id)},
64 manufacturer=device.api.manufacturer,
65 model=device.api.model,
67 sw_version=device.fw_version,
def async_added_to_hass(self)
def __init__(self, device)
def _update_state(self, data)
DeviceInfo device_info(self)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
None async_add_listener(HomeAssistant hass, Callable[[], None] listener)