From f2883531dfb3874e5770f69ed3a98700411dab01 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Sat, 18 Dec 2021 20:57:54 -0500 Subject: [PATCH] Added if to discovery main --- flickerstrip_py/discovery.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flickerstrip_py/discovery.py b/flickerstrip_py/discovery.py index b51933c..bfb52f5 100644 --- a/flickerstrip_py/discovery.py +++ b/flickerstrip_py/discovery.py @@ -27,5 +27,6 @@ class FlickerstripDiscoveryClient: if __name__ == "__main__": client = FlickerstripDiscoveryClient() flickerstrips = client.discover() - flickerstrips[0].force_update() - print(json.dumps(flickerstrips[0].status.to_json())) + if len(flickerstrips) > 0: + flickerstrips[0].force_update() + print(json.dumps(flickerstrips[0].status.to_json()))