mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-07-08 14:52:03 +00:00
Some checks are pending
CI / Perform Lint Checks (3.14) (push) Waiting to run
CI / Python 3.11 on macos-latest (push) Blocked by required conditions
CI / Python 3.12 on macos-latest (push) Blocked by required conditions
CI / Python 3.13 on macos-latest (push) Blocked by required conditions
CI / Python 3.14 on macos-latest (push) Blocked by required conditions
CI / Python 3.11 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.12 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.13 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.14 on ubuntu-latest (push) Blocked by required conditions
CI / Python 3.11 on windows-latest (push) Blocked by required conditions
CI / Python 3.12 on windows-latest (push) Blocked by required conditions
CI / Python 3.13 on windows-latest (push) Blocked by required conditions
CI / Python 3.14 on windows-latest (push) Blocked by required conditions
CodeQL Checks / Analyze (python) (push) Waiting to run
Add type annotations across all 'smart' tests, enabling mypy to check test function bodies, catching type errors that were previously hidden.
23 lines
669 B
Python
23 lines
669 B
Python
from kasa import Device, Module
|
|
|
|
from ...device_fixtures import parametrize
|
|
|
|
triggerlogs = parametrize(
|
|
"has trigger_logs",
|
|
component_filter="trigger_log",
|
|
protocol_filter={"SMART", "SMART.CHILD"},
|
|
)
|
|
|
|
|
|
@triggerlogs
|
|
async def test_trigger_logs(dev: Device) -> None:
|
|
"""Test that features are registered and work as expected."""
|
|
triggerlogs = dev.modules.get(Module.TriggerLogs)
|
|
assert triggerlogs is not None
|
|
if logs := triggerlogs.logs:
|
|
first = logs[0]
|
|
assert isinstance(first.id, int)
|
|
assert isinstance(first.timestamp, int)
|
|
assert isinstance(first.event, str)
|
|
assert isinstance(first.event_id, str)
|