mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
simplify loop in __init__ in smartstrip.py
This commit is contained in:
parent
b2ca20edf0
commit
8c25590186
@ -55,12 +55,12 @@ class SmartStrip(SmartPlug):
|
|||||||
self.plugs: List[SmartPlug] = []
|
self.plugs: List[SmartPlug] = []
|
||||||
children = self.sync.get_sys_info()["children"]
|
children = self.sync.get_sys_info()["children"]
|
||||||
self.num_children = len(children)
|
self.num_children = len(children)
|
||||||
for plug in range(self.num_children):
|
for child in children:
|
||||||
self.plugs.append(
|
self.plugs.append(
|
||||||
SmartPlug(
|
SmartPlug(
|
||||||
host,
|
host,
|
||||||
protocol,
|
protocol,
|
||||||
context=children[plug]["id"],
|
context=child["id"],
|
||||||
cache_ttl=cache_ttl,
|
cache_ttl=cache_ttl,
|
||||||
ioloop=ioloop,
|
ioloop=ioloop,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user