Fix Name of Homematic IP accesspoint in devices, if name is configured (#21617)
* Fix Name of Accesspoint if name is configured * fix lint * Simplyfied naming * applied suggestion Co-Authored-By: SukramJ <markus@mm-jankowski.de> * update comment
This commit is contained in:
parent
9c70b00403
commit
a46458d04f
1 changed files with 4 additions and 1 deletions
|
@ -60,11 +60,14 @@ async def async_setup_entry(hass, entry):
|
|||
# Register hap as device in registry.
|
||||
device_registry = await dr.async_get_registry(hass)
|
||||
home = hap.home
|
||||
# Add the HAP name from configuration if set.
|
||||
hapname = home.label \
|
||||
if not home.name else "{} {}".format(home.label, home.name)
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=home.id,
|
||||
identifiers={(DOMAIN, home.id)},
|
||||
manufacturer='eQ-3',
|
||||
name=home.label,
|
||||
name=hapname,
|
||||
model=home.modelType,
|
||||
sw_version=home.currentAPVersion,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue