File: test_lights.py

package info (click to toggle)
pydeconz 120-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 764 kB
  • sloc: python: 7,951; sh: 6; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Test pydeCONZ lights.

pytest --cov-report term-missing --cov=pydeconz.light tests/test_lights.py
"""

from tests import lights as light_test_data


async def test_create_all_light_types(deconz_refresh_state):
    """Verify that light types work."""
    deconz_session = await deconz_refresh_state(
        lights={
            "0": light_test_data.test_configuration_tool.DATA,
            "1": light_test_data.test_cover.DATA,
            "2": light_test_data.test_light.DATA,
            "3": light_test_data.test_lock.DATA,
            "4": light_test_data.test_siren.DATA,
            "5": {"type": "unsupported device"},
        },
    )

    lights = deconz_session.lights
    assert len(lights._handlers) == 6
    assert lights["0"].type == "Configuration tool"
    assert lights["1"].type == "Window covering device"
    assert lights["2"].type == "Extended color light"
    assert lights["3"].type == "Door Lock"
    assert lights["4"].type == "Warning device"
    assert lights["5"].type == "unsupported device"  # legacy support