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:
J. Nick Koston
2022-03-21 11:10:12 -10:00
committed by GitHub
parent b22f6b4eef
commit 58f6517445
8 changed files with 508 additions and 2 deletions

View File

@@ -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