Speed up TP-Link lights (#33606)

* Speed up TP-Link lights

* Color temp kan be None

* hs as int, force color temp=0

* Fix color temp?

* Additional tplink cleanups to reduce api calls

* Update test to return state, remove Throttle

* Fix state restore on off/on

* Fix lights without hue/sat

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus Schoutsen
2020-04-08 20:45:14 -07:00
co-authored by J. Nick Koston
parent 245eae89eb
commit ebac7b7aad
2 changed files with 173 additions and 116 deletions
+2 -1
View File
@@ -85,6 +85,7 @@ def light_mock_data_fixture() -> None:
light_state.update(state)
light_state["dft_on_state"] = drt_on_state
return light_state
set_light_state_patch = patch(
"homeassistant.components.tplink.common.SmartBulb.set_light_state",
@@ -310,7 +311,7 @@ async def test_get_light_state_retry(
if set_state_call_count == 1:
raise SmartDeviceException()
light_mock_data.set_light_state(state_data)
return light_mock_data.set_light_state(state_data)
light_mock_data.set_light_state_mock.side_effect = set_light_state_side_effect