From 8c255901860424cc8fb96c4f65167e69b6c24395 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 15 Nov 2019 16:51:01 +0100 Subject: [PATCH] simplify loop in __init__ in smartstrip.py --- pyHS100/smartstrip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyHS100/smartstrip.py b/pyHS100/smartstrip.py index 17e7d52b..ff3e44b9 100755 --- a/pyHS100/smartstrip.py +++ b/pyHS100/smartstrip.py @@ -55,12 +55,12 @@ class SmartStrip(SmartPlug): self.plugs: List[SmartPlug] = [] children = self.sync.get_sys_info()["children"] self.num_children = len(children) - for plug in range(self.num_children): + for child in children: self.plugs.append( SmartPlug( host, protocol, - context=children[plug]["id"], + context=child["id"], cache_ttl=cache_ttl, ioloop=ioloop, )