Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.lcn.helpers Namespace Reference

Functions

None async_update_config_entry (HomeAssistant hass, ConfigEntry config_entry)
 
None async_update_device_config (DeviceConnectionType device_connection, ConfigType device_config)
 
str generate_unique_id (str entry_id, AddressType address, str|None resource=None)
 
ConfigType|None get_device_config (AddressType address, ConfigEntry config_entry)
 
DeviceConnectionType get_device_connection (HomeAssistant hass, AddressType address, ConfigEntry config_entry)
 
str get_device_model (str domain_name, ConfigType domain_data)
 
str get_resource (str domain_name, ConfigType domain_data)
 
tuple[AddressType, str] is_address (str value)
 
list[str] is_states_string (str states_string)
 
None purge_device_registry (HomeAssistant hass, str entry_id, ConfigType imported_entry_data)
 
None purge_entity_registry (HomeAssistant hass, str entry_id, ConfigType imported_entry_data)
 
None register_lcn_address_devices (HomeAssistant hass, ConfigEntry config_entry)
 
None register_lcn_host_device (HomeAssistant hass, ConfigEntry config_entry)
 

Variables

 AddressType
 
 DeviceConnectionType
 
dictionary DOMAIN_LOOKUP
 
 InputType
 
 PATTERN_ADDRESS
 

Detailed Description

Helpers for LCN component.

Function Documentation

◆ async_update_config_entry()

None homeassistant.components.lcn.helpers.async_update_config_entry ( HomeAssistant  hass,
ConfigEntry   config_entry 
)
Fill missing values in config_entry with infos from LCN bus.

Definition at line 293 of file helpers.py.

◆ async_update_device_config()

None homeassistant.components.lcn.helpers.async_update_device_config ( DeviceConnectionType  device_connection,
ConfigType   device_config 
)
Fill missing values in device_config with infos from LCN bus.

Definition at line 262 of file helpers.py.

◆ generate_unique_id()

str homeassistant.components.lcn.helpers.generate_unique_id ( str  entry_id,
AddressType  address,
str | None   resource = None 
)
Generate a unique_id from the given parameters.

Definition at line 123 of file helpers.py.

◆ get_device_config()

ConfigType | None homeassistant.components.lcn.helpers.get_device_config ( AddressType  address,
ConfigEntry   config_entry 
)
Return the device configuration for given address and ConfigEntry.

Definition at line 313 of file helpers.py.

◆ get_device_connection()

DeviceConnectionType homeassistant.components.lcn.helpers.get_device_connection ( HomeAssistant  hass,
AddressType  address,
ConfigEntry   config_entry 
)
Return a lcn device_connection.

Definition at line 74 of file helpers.py.

◆ get_device_model()

str homeassistant.components.lcn.helpers.get_device_model ( str  domain_name,
ConfigType  domain_data 
)
Return the model for the specified domain_data.

Definition at line 98 of file helpers.py.

◆ get_resource()

str homeassistant.components.lcn.helpers.get_resource ( str  domain_name,
ConfigType  domain_data 
)
Return the resource for the specified domain_data.

Definition at line 83 of file helpers.py.

◆ is_address()

tuple[AddressType, str] homeassistant.components.lcn.helpers.is_address ( str  value)
Validate the given address string.

Examples for S000M005 at myhome:
    myhome.s000.m005
    myhome.s0.m5
    myhome.0.5    ("m" is implicit if missing)

Examples for s000g011
    myhome.0.g11
    myhome.s0.g11

Definition at line 323 of file helpers.py.

◆ is_states_string()

list[str] homeassistant.components.lcn.helpers.is_states_string ( str  states_string)
Validate the given states string and return states list.

Definition at line 343 of file helpers.py.

◆ purge_device_registry()

None homeassistant.components.lcn.helpers.purge_device_registry ( HomeAssistant  hass,
str  entry_id,
ConfigType   imported_entry_data 
)
Remove orphans from device registry which are not in entry data.

Definition at line 166 of file helpers.py.

◆ purge_entity_registry()

None homeassistant.components.lcn.helpers.purge_entity_registry ( HomeAssistant  hass,
str  entry_id,
ConfigType   imported_entry_data 
)
Remove orphans from entity registry which are not in entry data.

Definition at line 137 of file helpers.py.

◆ register_lcn_address_devices()

None homeassistant.components.lcn.helpers.register_lcn_address_devices ( HomeAssistant  hass,
ConfigEntry   config_entry 
)
Register LCN modules and groups defined in config_entry as devices in device registry.

The name of all given device_connections is collected and the devices
are updated.

Definition at line 222 of file helpers.py.

◆ register_lcn_host_device()

None homeassistant.components.lcn.helpers.register_lcn_host_device ( HomeAssistant  hass,
ConfigEntry  config_entry 
)
Register LCN host for given config_entry in device registry.

Definition at line 209 of file helpers.py.

Variable Documentation

◆ AddressType

homeassistant.components.lcn.helpers.AddressType

Definition at line 52 of file helpers.py.

◆ DeviceConnectionType

homeassistant.components.lcn.helpers.DeviceConnectionType

Definition at line 53 of file helpers.py.

◆ DOMAIN_LOOKUP

dictionary homeassistant.components.lcn.helpers.DOMAIN_LOOKUP
Initial value:
1 = {
2  CONF_BINARY_SENSORS: "binary_sensor",
3  CONF_CLIMATES: "climate",
4  CONF_COVERS: "cover",
5  CONF_LIGHTS: "light",
6  CONF_SCENES: "scene",
7  CONF_SENSORS: "sensor",
8  CONF_SWITCHES: "switch",
9 }

Definition at line 63 of file helpers.py.

◆ InputType

homeassistant.components.lcn.helpers.InputType

Definition at line 55 of file helpers.py.

◆ PATTERN_ADDRESS

homeassistant.components.lcn.helpers.PATTERN_ADDRESS
Initial value:
1 = re.compile(
2  "^((?P<conn_id>\\w+)\\.)?s?(?P<seg_id>\\d+)\\.(?P<type>m|g)?(?P<id>\\d+)$"
3 )

Definition at line 58 of file helpers.py.