Add test framework for smartcamera (#1192)

This commit is contained in:
Steven B.
2024-10-24 09:36:18 +01:00
committed by GitHub
parent 51958d8078
commit c839aaa1dd
6 changed files with 302 additions and 15 deletions

View File

View File

@@ -0,0 +1,20 @@
"""Tests for smart camera devices."""
from __future__ import annotations
import pytest
from kasa import Device, DeviceType
from ..conftest import device_smartcamera
@device_smartcamera
async def test_state(dev: Device):
if dev.device_type is DeviceType.Hub:
pytest.skip("Hubs cannot be switched on and off")
state = dev.is_on
await dev.set_state(not state)
await dev.update()
assert dev.is_on is not state