python-kasa/kasa/tests/smartcamera/test_smartcamera.py
2024-10-24 09:36:18 +01:00

21 lines
441 B
Python

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