From f814a7a8ae186e5057816ebf060b6c6fa2d0a07f Mon Sep 17 00:00:00 2001 From: gabrialdestruir <33361700+gabrialdestruir@users.noreply.github.com> Date: Sun, 9 May 2021 07:27:49 -0700 Subject: [PATCH] Add tplink light setting ignore default (#50334) This fixes issue #50115 by allowing color, brightness, and temperature to be set from an off state. This adds code to allow "ignore_default=1" to be sent to bulb letting it know to power on with the parameters set. --- homeassistant/components/tplink/light.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/tplink/light.py b/homeassistant/components/tplink/light.py index 61123bd6353..5984698a796 100644 --- a/homeassistant/components/tplink/light.py +++ b/homeassistant/components/tplink/light.py @@ -43,6 +43,7 @@ ATTR_DAILY_ENERGY_KWH = "daily_energy_kwh" ATTR_MONTHLY_ENERGY_KWH = "monthly_energy_kwh" LIGHT_STATE_DFT_ON = "dft_on_state" +LIGHT_STATE_DFT_IGNORE = "ignore_default" LIGHT_STATE_ON_OFF = "on_off" LIGHT_STATE_RELAY_STATE = "relay_state" LIGHT_STATE_BRIGHTNESS = "brightness" @@ -117,6 +118,7 @@ class LightState(NamedTuple): return { LIGHT_STATE_ON_OFF: 1 if self.state else 0, + LIGHT_STATE_DFT_IGNORE: 1 if self.state else 0, LIGHT_STATE_BRIGHTNESS: brightness_to_percentage(self.brightness), LIGHT_STATE_COLOR_TEMP: color_temp, LIGHT_STATE_HUE: self.hs[0] if self.hs else 0,