python-kasa/tests/iot/modules/test_schedule.py
Steven B. f7778aaa53
Migrate RuleModule to mashumaro (#1283)
Also fixes a bug whereby multiple queries for the same module would overwrite each other.
2024-11-20 14:59:32 +00:00

18 lines
515 B
Python

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