mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
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.
This commit is contained in:
parent
cbf4632895
commit
f814a7a8ae
@ -43,6 +43,7 @@ ATTR_DAILY_ENERGY_KWH = "daily_energy_kwh"
|
|||||||
ATTR_MONTHLY_ENERGY_KWH = "monthly_energy_kwh"
|
ATTR_MONTHLY_ENERGY_KWH = "monthly_energy_kwh"
|
||||||
|
|
||||||
LIGHT_STATE_DFT_ON = "dft_on_state"
|
LIGHT_STATE_DFT_ON = "dft_on_state"
|
||||||
|
LIGHT_STATE_DFT_IGNORE = "ignore_default"
|
||||||
LIGHT_STATE_ON_OFF = "on_off"
|
LIGHT_STATE_ON_OFF = "on_off"
|
||||||
LIGHT_STATE_RELAY_STATE = "relay_state"
|
LIGHT_STATE_RELAY_STATE = "relay_state"
|
||||||
LIGHT_STATE_BRIGHTNESS = "brightness"
|
LIGHT_STATE_BRIGHTNESS = "brightness"
|
||||||
@ -117,6 +118,7 @@ class LightState(NamedTuple):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
LIGHT_STATE_ON_OFF: 1 if self.state else 0,
|
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_BRIGHTNESS: brightness_to_percentage(self.brightness),
|
||||||
LIGHT_STATE_COLOR_TEMP: color_temp,
|
LIGHT_STATE_COLOR_TEMP: color_temp,
|
||||||
LIGHT_STATE_HUE: self.hs[0] if self.hs else 0,
|
LIGHT_STATE_HUE: self.hs[0] if self.hs else 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user