mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-05 07:02:05 +00:00
Add effect support for light strips (#293)
* Add effect support for KL430 * KL400 supports effects * Add KL400 fixture * Comments from review * actually commit the remove
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from kasa import DeviceType, SmartLightStrip
|
||||
from kasa.exceptions import SmartDeviceException
|
||||
|
||||
from .conftest import lightstrip, pytestmark
|
||||
|
||||
@@ -15,3 +18,19 @@ async def test_lightstrip_effect(dev: SmartLightStrip):
|
||||
assert isinstance(dev.effect, dict)
|
||||
for k in ["brightness", "custom", "enable", "id", "name"]:
|
||||
assert k in dev.effect
|
||||
|
||||
|
||||
@lightstrip
|
||||
async def test_effects_lightstrip_set_effect(dev: SmartLightStrip):
|
||||
with pytest.raises(SmartDeviceException):
|
||||
await dev.set_effect("Not real")
|
||||
|
||||
await dev.set_effect("Candy Cane")
|
||||
assert dev.effect["name"] == "Candy Cane"
|
||||
assert dev.state_information["Effect"] == "Candy Cane"
|
||||
|
||||
|
||||
@lightstrip
|
||||
async def test_effects_lightstrip_has_effects(dev: SmartLightStrip):
|
||||
assert dev.has_effects is True
|
||||
assert dev.effect_list
|
||||
|
||||
Reference in New Issue
Block a user