mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Add test framework for smartcamera (#1192)
This commit is contained in:
0
kasa/tests/smartcamera/__init__.py
Normal file
0
kasa/tests/smartcamera/__init__.py
Normal file
20
kasa/tests/smartcamera/test_smartcamera.py
Normal file
20
kasa/tests/smartcamera/test_smartcamera.py
Normal 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
|
Reference in New Issue
Block a user