-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from bdraco/old_socket_firmware
Add tests for older socket firmware
- Loading branch information
Showing
2 changed files
with
70 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,40 @@ | ||
"""Tests for the Bulb API with a socket.""" | ||
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 socket() -> AsyncGenerator[wizlight, None]: | ||
shutdown, port = await startup_bulb( | ||
module_name="ESP10_SOCKET_06", firmware_version="1.16.71" | ||
) | ||
bulb = wizlight(ip="127.0.0.1", port=port) | ||
yield bulb | ||
await bulb.async_close() | ||
shutdown() | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_model_description_socket(socket: wizlight) -> None: | ||
"""Test fetching the model description of a socket is None.""" | ||
bulb_type = await socket.get_bulbtype() | ||
assert bulb_type == BulbType( | ||
features=Features( | ||
color=False, | ||
color_tmp=False, | ||
effect=False, | ||
brightness=False, | ||
dual_head=False, | ||
), | ||
name="ESP10_SOCKET_06", | ||
kelvin_range=KelvinRange(max=6500, min=2700), | ||
bulb_type=BulbClass.SOCKET, | ||
fw_version="1.16.71", | ||
white_channels=2, | ||
white_to_color_ratio=20, | ||
) |