Skip to content

Commit 2ce9e24

Browse files
authored
Merge pull request #1431 from Bastian-Krause/bst/kasa-0.7.0
driver/power/tplink: use IotStrip instead of deprecated SmartStrip
2 parents c7d8062 + e46c76c commit 2ce9e24

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

labgrid/driver/power/tplink.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
""" Tested with TP Link KP303, and should be compatible with any strip supported by kasa """
22

33
import asyncio
4-
from kasa import SmartStrip
4+
from kasa.iot import IotStrip
55

66

77
async def _power_set(host, port, index, value):
88
"""We embed the coroutines in an `async` function to minimise calls to `asyncio.run`"""
99
assert port is None
1010
index = int(index)
11-
strip = SmartStrip(host)
11+
strip = IotStrip(host)
1212
await strip.update()
1313
assert (
1414
len(strip.children) > index
@@ -26,7 +26,7 @@ def power_set(host, port, index, value):
2626
def power_get(host, port, index):
2727
assert port is None
2828
index = int(index)
29-
strip = SmartStrip(host)
29+
strip = IotStrip(host)
3030
asyncio.run(strip.update())
3131
assert (
3232
len(strip.children) > index

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ doc = [
6060
]
6161
docker = ["docker>=5.0.2"]
6262
graph = ["graphviz>=0.17.0"]
63-
kasa = ["python-kasa>=0.4.0"]
63+
kasa = ["python-kasa>=0.7.0"]
6464
modbus = ["pyModbusTCP>=0.2.0"]
6565
modbusrtu = ["minimalmodbus>=1.0.2"]
6666
mqtt = ["paho-mqtt>=2.0.0"]

0 commit comments

Comments
 (0)