mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-15 03:48:01 +00:00
Rename smartcamera to smartcam (#1300)
This commit is contained in:
@@ -5,21 +5,21 @@ from __future__ import annotations
|
||||
import pytest
|
||||
|
||||
from kasa import Device
|
||||
from kasa.smartcamera.modules.alarm import (
|
||||
from kasa.smartcam.modules.alarm import (
|
||||
DURATION_MAX,
|
||||
DURATION_MIN,
|
||||
VOLUME_MAX,
|
||||
VOLUME_MIN,
|
||||
)
|
||||
from kasa.smartcamera.smartcameramodule import SmartCameraModule
|
||||
from kasa.smartcam.smartcammodule import SmartCamModule
|
||||
|
||||
from ...conftest import hub_smartcamera
|
||||
from ...conftest import hub_smartcam
|
||||
|
||||
|
||||
@hub_smartcamera
|
||||
@hub_smartcam
|
||||
async def test_alarm(dev: Device):
|
||||
"""Test device alarm."""
|
||||
alarm = dev.modules.get(SmartCameraModule.SmartCameraAlarm)
|
||||
alarm = dev.modules.get(SmartCamModule.SmartCamAlarm)
|
||||
assert alarm
|
||||
|
||||
original_duration = alarm.alarm_duration
|
||||
@@ -70,10 +70,10 @@ async def test_alarm(dev: Device):
|
||||
await dev.update()
|
||||
|
||||
|
||||
@hub_smartcamera
|
||||
@hub_smartcam
|
||||
async def test_alarm_invalid_setters(dev: Device):
|
||||
"""Test device alarm invalid setter values."""
|
||||
alarm = dev.modules.get(SmartCameraModule.SmartCameraAlarm)
|
||||
alarm = dev.modules.get(SmartCamModule.SmartCamAlarm)
|
||||
assert alarm
|
||||
|
||||
# test set sound invalid
|
||||
@@ -92,10 +92,10 @@ async def test_alarm_invalid_setters(dev: Device):
|
||||
await alarm.set_alarm_duration(-3)
|
||||
|
||||
|
||||
@hub_smartcamera
|
||||
@hub_smartcam
|
||||
async def test_alarm_features(dev: Device):
|
||||
"""Test device alarm features."""
|
||||
alarm = dev.modules.get(SmartCameraModule.SmartCameraAlarm)
|
||||
alarm = dev.modules.get(SmartCamModule.SmartCamAlarm)
|
||||
assert alarm
|
||||
|
||||
original_duration = alarm.alarm_duration
|
||||
|
@@ -12,10 +12,10 @@ from freezegun.api import FrozenDateTimeFactory
|
||||
|
||||
from kasa import Credentials, Device, DeviceType, Module
|
||||
|
||||
from ..conftest import camera_smartcamera, device_smartcamera, hub_smartcamera
|
||||
from ..conftest import camera_smartcam, device_smartcam, hub_smartcam
|
||||
|
||||
|
||||
@device_smartcamera
|
||||
@device_smartcam
|
||||
async def test_state(dev: Device):
|
||||
if dev.device_type is DeviceType.Hub:
|
||||
pytest.skip("Hubs cannot be switched on and off")
|
||||
@@ -26,7 +26,7 @@ async def test_state(dev: Device):
|
||||
assert dev.is_on is not state
|
||||
|
||||
|
||||
@camera_smartcamera
|
||||
@camera_smartcam
|
||||
async def test_stream_rtsp_url(dev: Device):
|
||||
camera_module = dev.modules.get(Module.Camera)
|
||||
assert camera_module
|
||||
@@ -85,7 +85,7 @@ async def test_stream_rtsp_url(dev: Device):
|
||||
assert url is None
|
||||
|
||||
|
||||
@device_smartcamera
|
||||
@device_smartcam
|
||||
async def test_alias(dev):
|
||||
test_alias = "TEST1234"
|
||||
original = dev.alias
|
||||
@@ -100,7 +100,7 @@ async def test_alias(dev):
|
||||
assert dev.alias == original
|
||||
|
||||
|
||||
@hub_smartcamera
|
||||
@hub_smartcam
|
||||
async def test_hub(dev):
|
||||
assert dev.children
|
||||
for child in dev.children:
|
||||
@@ -112,7 +112,7 @@ async def test_hub(dev):
|
||||
assert child.time
|
||||
|
||||
|
||||
@device_smartcamera
|
||||
@device_smartcam
|
||||
async def test_device_time(dev: Device, freezer: FrozenDateTimeFactory):
|
||||
"""Test a child device gets the time from it's parent module."""
|
||||
fallback_time = datetime.now(UTC).astimezone().replace(microsecond=0)
|
||||
|
Reference in New Issue
Block a user