mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
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
@ -60,11 +60,14 @@ async def async_setup_entry(hass, entry):
|
|||||||
# Register hap as device in registry.
|
# Register hap as device in registry.
|
||||||
device_registry = await dr.async_get_registry(hass)
|
device_registry = await dr.async_get_registry(hass)
|
||||||
home = hap.home
|
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(
|
device_registry.async_get_or_create(
|
||||||
config_entry_id=home.id,
|
config_entry_id=home.id,
|
||||||
identifiers={(DOMAIN, home.id)},
|
identifiers={(DOMAIN, home.id)},
|
||||||
manufacturer='eQ-3',
|
manufacturer='eQ-3',
|
||||||
name=home.label,
|
name=hapname,
|
||||||
model=home.modelType,
|
model=home.modelType,
|
||||||
sw_version=home.currentAPVersion,
|
sw_version=home.currentAPVersion,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user