From 0dd49ae959d2eecb609e4dbb88ba10200dfcb6a7 Mon Sep 17 00:00:00 2001 From: Dmitry Mamontov Date: Fri, 15 Apr 2022 21:08:58 +0300 Subject: [PATCH] Fix discovery --- custom_components/miwifi/discovery.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/miwifi/discovery.py b/custom_components/miwifi/discovery.py index 94f7ce5..7b9e29f 100644 --- a/custom_components/miwifi/discovery.py +++ b/custom_components/miwifi/discovery.py @@ -119,7 +119,12 @@ def parse_leafs(devices: list, leafs: list) -> list: """ for leaf in leafs: - if "ip" not in leaf or len(leaf["ip"]) == 0: + if ( + "ip" not in leaf + or len(leaf["ip"]) == 0 + or "hardware" not in leaf + or len(leaf["hardware"]) == 0 + ): continue devices.append(leaf["ip"].strip())