mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-15 06:38:42 +00:00
Put modules back on children for wall switches (#881)
Puts modules back on the children for `WallSwitches` (i.e. ks240) and makes them accessible from the `modules` property on the parent.
This commit is contained in:
@@ -39,6 +39,7 @@ from kasa.iot import (
|
||||
IotStrip,
|
||||
IotWallSwitch,
|
||||
)
|
||||
from kasa.iot.modules import Usage
|
||||
from kasa.smart import SmartBulb, SmartDevice
|
||||
|
||||
try:
|
||||
@@ -829,7 +830,7 @@ async def usage(dev: Device, year, month, erase):
|
||||
Daily and monthly data provided in CSV format.
|
||||
"""
|
||||
echo("[bold]== Usage ==[/bold]")
|
||||
usage = dev.modules["usage"]
|
||||
usage = cast(Usage, dev.modules["usage"])
|
||||
|
||||
if erase:
|
||||
echo("Erasing usage statistics..")
|
||||
|
||||
Reference in New Issue
Block a user