mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Add brightness to lightstrip's set_effect (#415)
* Add brightness parameter to lightstrip's set_effect * Use None as default as effects have different default brightnesses
This commit is contained in:
@@ -30,6 +30,23 @@ async def test_effects_lightstrip_set_effect(dev: SmartLightStrip):
|
||||
assert dev.state_information["Effect"] == "Candy Cane"
|
||||
|
||||
|
||||
@lightstrip
|
||||
@pytest.mark.parametrize("brightness", [100, 50])
|
||||
async def test_effects_lightstrip_set_effect_brightness(
|
||||
dev: SmartLightStrip, brightness, mocker
|
||||
):
|
||||
query_helper = mocker.patch("kasa.SmartLightStrip._query_helper")
|
||||
|
||||
if brightness == 100: # test that default brightness works
|
||||
await dev.set_effect("Candy Cane")
|
||||
else:
|
||||
await dev.set_effect("Candy Cane", brightness=brightness)
|
||||
|
||||
args, kwargs = query_helper.call_args_list[0]
|
||||
payload = args[2]
|
||||
assert payload["brightness"] == brightness
|
||||
|
||||
|
||||
@lightstrip
|
||||
async def test_effects_lightstrip_has_effects(dev: SmartLightStrip):
|
||||
assert dev.has_effects is True
|
||||
|
Reference in New Issue
Block a user