1 """KIRA interface to receive UDP packets from an IR-IP bridge."""
3 from __future__
import annotations
13 from .
import CONF_SENSOR, DOMAIN
15 _LOGGER = logging.getLogger(__name__)
21 add_entities: AddEntitiesCallback,
22 discovery_info: DiscoveryInfoType |
None =
None,
24 """Set up a Kira sensor."""
25 if discovery_info
is not None:
26 name = discovery_info.get(CONF_NAME)
27 device = discovery_info.get(CONF_DEVICE)
28 kira = hass.data[DOMAIN][CONF_SENSOR][name]
34 """Implementation of a Kira Receiver."""
36 _attr_force_update =
True
37 _attr_icon =
"mdi:remote"
38 _attr_should_poll =
False
41 """Initialize the sensor."""
48 code_name, device = code
49 _LOGGER.debug(
"Kira Code: %s", code_name)
_attr_extra_state_attributes
def __init__(self, name, kira)
def _update_callback(self, code)
None schedule_update_ha_state(self, bool force_refresh=False)
def add_entities(account, async_add_entities, tracked)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)