Files
python-kasa/tests/smart/modules/test_triggerlogs.py
ZeliardM 88e1c27bd0
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
tests: add type annotations to Smart tests (#1686)
Add type annotations across all 'smart' tests, enabling mypy to check test function bodies, catching type errors that were previously hidden.
2026-07-08 00:11:59 +02:00

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)