Fix UPC ConnectBox logout and device hostnames (#39568)

This commit is contained in:
Olivér Falvai 2020-09-02 14:56:32 +02:00 committed by GitHub
parent 6de02fc1b9
commit 70e39a26a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -69,8 +69,10 @@ class UPCDeviceScanner(DeviceScanner):
async def async_get_device_name(self, device: str) -> Optional[str]: async def async_get_device_name(self, device: str) -> Optional[str]:
"""Get the device name (the name of the wireless device not used).""" """Get the device name (the name of the wireless device not used)."""
for connected_device in self.connect_box.devices: for connected_device in self.connect_box.devices:
if connected_device != device: if (
continue connected_device.mac == device
return connected_device.hostname and connected_device.hostname.lower() != "unknown"
):
return connected_device.hostname
return None return None

View File

@ -2,6 +2,6 @@
"domain": "upc_connect", "domain": "upc_connect",
"name": "UPC Connect Box", "name": "UPC Connect Box",
"documentation": "https://www.home-assistant.io/integrations/upc_connect", "documentation": "https://www.home-assistant.io/integrations/upc_connect",
"requirements": ["connect-box==0.2.7"], "requirements": ["connect-box==0.2.8"],
"codeowners": ["@pvizeli", "@fabaff"] "codeowners": ["@pvizeli", "@fabaff"]
} }

View File

@ -436,7 +436,7 @@ colorlog==4.2.1
concord232==0.15 concord232==0.15
# homeassistant.components.upc_connect # homeassistant.components.upc_connect
connect-box==0.2.7 connect-box==0.2.8
# homeassistant.components.eddystone_temperature # homeassistant.components.eddystone_temperature
# homeassistant.components.eq3btsmart # homeassistant.components.eq3btsmart