mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
d890b0a3ac
Some checks are pending
CI / Perform linting checks (3.13) (push) Waiting to run
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, macos-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, ubuntu-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (false, windows-latest, 3.13) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.11) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.12) (push) Blocked by required conditions
CI / Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }} (true, ubuntu-latest, 3.13) (push) Blocked by required conditions
CodeQL checks / Analyze (python) (push) Waiting to run
- Motion detection - Person detection - Tamper detection - Baby Cry Detection
46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
"""Tests for smartcam baby cry detection module."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from kasa import Device
|
|
from kasa.smartcam.smartcammodule import SmartCamModule
|
|
|
|
from ...device_fixtures import parametrize
|
|
|
|
babycrydetection = parametrize(
|
|
"has babycry detection",
|
|
component_filter="babyCryDetection",
|
|
protocol_filter={"SMARTCAM"},
|
|
)
|
|
|
|
|
|
@babycrydetection
|
|
async def test_babycrydetection(dev: Device):
|
|
"""Test device babycry detection."""
|
|
babycry = dev.modules.get(SmartCamModule.SmartCamBabyCryDetection)
|
|
assert babycry
|
|
|
|
bcde_feat = dev.features.get("baby_cry_detection")
|
|
assert bcde_feat
|
|
|
|
original_enabled = babycry.enabled
|
|
|
|
try:
|
|
await babycry.set_enabled(not original_enabled)
|
|
await dev.update()
|
|
assert babycry.enabled is not original_enabled
|
|
assert bcde_feat.value is not original_enabled
|
|
|
|
await babycry.set_enabled(original_enabled)
|
|
await dev.update()
|
|
assert babycry.enabled is original_enabled
|
|
assert bcde_feat.value is original_enabled
|
|
|
|
await bcde_feat.set_value(not original_enabled)
|
|
await dev.update()
|
|
assert babycry.enabled is not original_enabled
|
|
assert bcde_feat.value is not original_enabled
|
|
|
|
finally:
|
|
await babycry.set_enabled(original_enabled)
|