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 SchoutsenandJ. Nick Koston authored and GitHub committed 2020-04-08 14:36:45 -05:00
1 parent 292dcb7e37
commit df744c5944
2 files changed
+173 -116

No files matched your search

+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