From a46458d04f19ab1f23298b62bec989f5e59981da Mon Sep 17 00:00:00 2001 From: Markus Jankowski Date: Thu, 7 Mar 2019 11:07:32 +0100 Subject: [PATCH] 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 * update comment --- homeassistant/components/homematicip_cloud/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/homematicip_cloud/__init__.py b/homeassistant/components/homematicip_cloud/__init__.py index 7bc5f33d42f..ac93ef05b85 100644 --- a/homeassistant/components/homematicip_cloud/__init__.py +++ b/homeassistant/components/homematicip_cloud/__init__.py @@ -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, )