1 """Handle KNX Devices."""
3 from __future__
import annotations
6 from xknx.core
import XknxConnectionState
7 from xknx.io.gateway_scanner
import GatewayDescriptor
14 from .const
import DOMAIN
18 """Class for KNX Interface Device handling."""
20 def __init__(self, hass: HomeAssistant, entry: ConfigEntry, xknx: XKNX) ->
None:
21 """Initialize interface device class."""
27 _device_id = (DOMAIN, f
"_{entry.entry_id}_interface")
29 config_entry_id=entry.entry_id,
31 identifiers={_device_id},
35 self.
xknxxknx.connection_manager.register_connection_state_changed_cb(
40 """Update interface properties on new connection."""
44 device_id=self.
devicedevice.id,
51 """Call invoked after a KNX connection state change was received."""
52 if state
is XknxConnectionState.CONNECTED:
53 self.
hasshass.async_create_task(self.
updateupdate())
None connection_state_changed_cb(self, XknxConnectionState state)
None __init__(self, HomeAssistant hass, ConfigEntry entry, XKNX xknx)
None async_update_device(HomeAssistant hass, ConfigEntry entry, str adapter, AdapterDetails details)