python-kasa/kasa/tests/smartcamera/test_smartcamera.py

21 lines
441 B
Python
Raw Normal View History

"""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