From 6afd05be5970d90c2093767ebd7567ccc20dc641 Mon Sep 17 00:00:00 2001 From: Teemu R Date: Sat, 3 Feb 2024 15:28:51 +0100 Subject: [PATCH] Do not crash cli on missing discovery info (#735) --- kasa/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kasa/cli.py b/kasa/cli.py index 3906fdcb..04f16fbd 100755 --- a/kasa/cli.py +++ b/kasa/cli.py @@ -471,6 +471,10 @@ def _echo_dictionary(discovery_info: dict): def _echo_discovery_info(discovery_info): + # We don't have discovery info when all connection params are passed manually + if discovery_info is None: + return + if "system" in discovery_info and "get_sysinfo" in discovery_info["system"]: _echo_dictionary(discovery_info["system"]["get_sysinfo"]) return