mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 11:43:34 +00:00
f7778aaa53
Also fixes a bug whereby multiple queries for the same module would overwrite each other.
18 lines
515 B
Python
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
|