-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Tests for the Bulb API with a turnable white device with 1.10.0 firmware.""" | ||
from typing import AsyncGenerator | ||
|
||
import pytest | ||
|
||
from pywizlight import wizlight | ||
from pywizlight.bulblibrary import BulbClass, BulbType, Features, KelvinRange | ||
from pywizlight.tests.fake_bulb import startup_bulb | ||
|
||
|
||
@pytest.fixture() | ||
async def turnable_bulb() -> AsyncGenerator[wizlight, None]: | ||
shutdown, port = await startup_bulb( | ||
module_name="ESP05_SHTW_21", firmware_version="1.10.0" | ||
) | ||
bulb = wizlight(ip="127.0.0.1", port=port) | ||
yield bulb | ||
await bulb.async_close() | ||
shutdown() | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_model_description_dimmable_bulb(turnable_bulb: wizlight) -> None: | ||
"""Test fetching the model description dimmable bulb.""" | ||
bulb_type = await turnable_bulb.get_bulbtype() | ||
assert bulb_type == BulbType( | ||
features=Features( | ||
color=False, color_tmp=True, effect=True, brightness=True, dual_head=False | ||
), | ||
name="ESP05_SHTW_21", | ||
kelvin_range=KelvinRange(max=6500, min=2700), | ||
bulb_type=BulbClass.TW, | ||
fw_version="1.10.0", | ||
white_channels=1, | ||
white_to_color_ratio=20, | ||
) |