power: tplink smartstrip fix

Correct the procedure for setting the child id for devices that control more than one outlet.

Signed-off-by: Rick Marino <rcmarino@gmail.com>
This commit is contained in:
mista-funky authored and GitHub committed 2023-07-22 06:34:29 -04:00
1 parent 821f3c5161
commit fe52bc5b6d
1 file changed
+3 -4
+3 -4
View File
@@ -809,10 +809,9 @@ class TPLinkSmartPlug(PowerDevice):
# TPLink device controls multiple devices
if self.output_id is not None:
sysinfo = await self._send_tplink_command("info")
dev_id = sysinfo["system"]["get_sysinfo"]["deviceId"]
out_cmd["context"] = {
'child_ids': [f"{dev_id}{self.output_id:02}"]
}
children = sysinfo["system"]["get_sysinfo"]["children"]
child_id = children[self.output_id]["id"]
out_cmd["context"] = {"child_ids": [f"{child_id}"]}
elif command == "info":
out_cmd = {'system': {'get_sysinfo': {}}}
elif command == "clear_rules":