mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 18:54:08 +00:00
Add ColorModule for smart devices (#840)
Adds support L530 hw_version 1.0
This commit is contained in:
@@ -237,6 +237,11 @@ variable_temp_iot = parametrize(
|
||||
model_filter=BULBS_IOT_VARIABLE_TEMP,
|
||||
protocol_filter={"IOT"},
|
||||
)
|
||||
variable_temp_smart = parametrize(
|
||||
"variable color temp smart",
|
||||
model_filter=BULBS_SMART_VARIABLE_TEMP,
|
||||
protocol_filter={"SMART"},
|
||||
)
|
||||
|
||||
bulb_smart = parametrize(
|
||||
"bulb devices smart",
|
||||
|
@@ -1,12 +1,10 @@
|
||||
import pytest
|
||||
|
||||
from kasa.smart import SmartDevice
|
||||
from kasa.tests.conftest import parametrize
|
||||
|
||||
brightness = parametrize("colortemp smart", component_filter="color_temperature")
|
||||
from kasa.tests.conftest import variable_temp_smart
|
||||
|
||||
|
||||
@brightness
|
||||
@variable_temp_smart
|
||||
async def test_colortemp_component(dev: SmartDevice):
|
||||
"""Test brightness feature."""
|
||||
assert isinstance(dev, SmartDevice)
|
||||
|
@@ -9,6 +9,7 @@ from voluptuous import (
|
||||
|
||||
from kasa import Bulb, BulbPreset, DeviceType, KasaException
|
||||
from kasa.iot import IotBulb
|
||||
from kasa.smart import SmartBulb
|
||||
|
||||
from .conftest import (
|
||||
bulb,
|
||||
@@ -23,6 +24,7 @@ from .conftest import (
|
||||
turn_on,
|
||||
variable_temp,
|
||||
variable_temp_iot,
|
||||
variable_temp_smart,
|
||||
)
|
||||
from .test_iotdevice import SYSINFO_SCHEMA
|
||||
|
||||
@@ -159,6 +161,11 @@ async def test_unknown_temp_range(dev: IotBulb, monkeypatch, caplog):
|
||||
assert "Unknown color temperature range, fallback to 2700-5000" in caplog.text
|
||||
|
||||
|
||||
@variable_temp_smart
|
||||
async def test_smart_temp_range(dev: SmartBulb):
|
||||
assert dev.valid_temperature_range
|
||||
|
||||
|
||||
@variable_temp
|
||||
async def test_out_of_range_temperature(dev: Bulb):
|
||||
with pytest.raises(ValueError):
|
||||
|
Reference in New Issue
Block a user