From a9cefec1db3519790de6a65372ecf977f283f07b Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Sun, 23 Jan 2022 01:42:23 +0100 Subject: [PATCH] Motionblinds improvements (#64698) * use gateway_mac as identifier see revieuw request: https://github.com/home-assistant/core/pull/64414#discussion_r787691139 * show hw_version and add interface "0.0.0.0" --- homeassistant/components/motion_blinds/__init__.py | 2 +- homeassistant/components/motion_blinds/config_flow.py | 2 +- homeassistant/components/motion_blinds/cover.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/motion_blinds/__init__.py b/homeassistant/components/motion_blinds/__init__.py index 7f31ecf3f61..b3712e6e832 100644 --- a/homeassistant/components/motion_blinds/__init__.py +++ b/homeassistant/components/motion_blinds/__init__.py @@ -164,7 +164,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: device_registry.async_get_or_create( config_entry_id=entry.entry_id, connections={(dr.CONNECTION_NETWORK_MAC, motion_gateway.mac)}, - identifiers={(DOMAIN, entry.unique_id)}, + identifiers={(DOMAIN, motion_gateway.mac)}, manufacturer=MANUFACTURER, name=entry.title, model="Wi-Fi bridge", diff --git a/homeassistant/components/motion_blinds/config_flow.py b/homeassistant/components/motion_blinds/config_flow.py index 12d4a3440ec..90ee92ccff3 100644 --- a/homeassistant/components/motion_blinds/config_flow.py +++ b/homeassistant/components/motion_blinds/config_flow.py @@ -166,7 +166,7 @@ class MotionBlindsFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): async def async_get_interfaces(self): """Get list of interface to use.""" - interfaces = [DEFAULT_INTERFACE] + interfaces = [DEFAULT_INTERFACE, "0.0.0.0"] enabled_interfaces = [] default_interface = DEFAULT_INTERFACE diff --git a/homeassistant/components/motion_blinds/cover.py b/homeassistant/components/motion_blinds/cover.py index 5ef4e687969..f5eff45539e 100644 --- a/homeassistant/components/motion_blinds/cover.py +++ b/homeassistant/components/motion_blinds/cover.py @@ -145,7 +145,8 @@ class MotionPositionDevice(CoordinatorEntity, CoverEntity): manufacturer=MANUFACTURER, model=blind.blind_type, name=f"{blind.blind_type}-{blind.mac[12:]}", - via_device=(DOMAIN, config_entry.unique_id), + via_device=(DOMAIN, blind._gateway.mac), + hw_version=blind.wireless_name, ) @property