From 689b347904857c77c1346f3f1e971f2dc31d49ca Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 8 Apr 2022 21:08:17 -1000 Subject: [PATCH] Increase tplink effects random seed allowed range to 1-600 (#69725) * Increase tplink effects random seed allowed range to 1-600 Reported https://community.home-assistant.io/t/tp-link-integration-support-for-kl430-led-light-strip/190635/62?u=bdraco * cover --- homeassistant/components/tplink/light.py | 2 +- homeassistant/components/tplink/services.yaml | 2 +- tests/components/tplink/test_light.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/tplink/light.py b/homeassistant/components/tplink/light.py index 32af7cf47be..ecbcb84d772 100644 --- a/homeassistant/components/tplink/light.py +++ b/homeassistant/components/tplink/light.py @@ -101,7 +101,7 @@ RANDOM_EFFECT_DICT: Final = { cv.ensure_list_csv, [vol.Coerce(int)], HSV_SEQUENCE ), vol.Optional("random_seed", default=100): vol.All( - vol.Coerce(int), vol.Range(min=1, max=100) + vol.Coerce(int), vol.Range(min=1, max=600) ), vol.Optional("backgrounds"): vol.All( cv.ensure_list, diff --git a/homeassistant/components/tplink/services.yaml b/homeassistant/components/tplink/services.yaml index 6f2d9054b1e..9b98018e771 100644 --- a/homeassistant/components/tplink/services.yaml +++ b/homeassistant/components/tplink/services.yaml @@ -180,4 +180,4 @@ random_effect: number: min: 1 step: 1 - max: 100 + max: 600 diff --git a/tests/components/tplink/test_light.py b/tests/components/tplink/test_light.py index c56bb6399fb..e5d20276490 100644 --- a/tests/components/tplink/test_light.py +++ b/tests/components/tplink/test_light.py @@ -523,6 +523,7 @@ async def test_smart_strip_custom_random_effect(hass: HomeAssistant) -> None: { ATTR_ENTITY_ID: entity_id, "init_states": [340, 20, 50], + "random_seed": 600, }, blocking=True, ) @@ -539,7 +540,7 @@ async def test_smart_strip_custom_random_effect(hass: HomeAssistant) -> None: "transition": 0, "type": "random", "init_states": [[340, 20, 50]], - "random_seed": 100, + "random_seed": 600, } ) strip.set_custom_effect.reset_mock()