mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 18:54:08 +00:00
Migrate RuleModule to mashumaro (#1283)
Also fixes a bug whereby multiple queries for the same module would overwrite each other.
This commit is contained in:
17
tests/iot/modules/test_schedule.py
Normal file
17
tests/iot/modules/test_schedule.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import pytest
|
||||
|
||||
from kasa import Device, Module
|
||||
from kasa.iot.modules.rulemodule import Action, TimeOption
|
||||
|
||||
from ...device_fixtures import device_iot
|
||||
|
||||
|
||||
@device_iot
|
||||
def test_schedule(dev: Device, caplog: pytest.LogCaptureFixture):
|
||||
schedule = dev.modules.get(Module.IotSchedule)
|
||||
assert schedule
|
||||
if rules := schedule.rules:
|
||||
first = rules[0]
|
||||
assert isinstance(first.sact, Action)
|
||||
assert isinstance(first.stime_opt, TimeOption)
|
||||
assert "Unable to read rule list" not in caplog.text
|
Reference in New Issue
Block a user