mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 17:27:45 +01:00
Correctly set warm white variables (#569)
This commit is contained in:
parent
7f507935b1
commit
31821e6309
3 changed files with 3 additions and 3 deletions
|
@ -20,7 +20,7 @@ class CWWWLightOutput : public light::LightOutput {
|
||||||
traits.set_supports_rgb_white_value(false);
|
traits.set_supports_rgb_white_value(false);
|
||||||
traits.set_supports_color_temperature(true);
|
traits.set_supports_color_temperature(true);
|
||||||
traits.set_min_mireds(this->cold_white_temperature_);
|
traits.set_min_mireds(this->cold_white_temperature_);
|
||||||
traits.set_min_mireds(this->warm_white_temperature_);
|
traits.set_max_mireds(this->warm_white_temperature_);
|
||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
void write_state(light::LightState *state) override {
|
void write_state(light::LightState *state) override {
|
||||||
|
|
|
@ -37,4 +37,4 @@ def to_code(config):
|
||||||
|
|
||||||
wwhite = yield cg.get_variable(config[CONF_WARM_WHITE])
|
wwhite = yield cg.get_variable(config[CONF_WARM_WHITE])
|
||||||
cg.add(var.set_warm_white(wwhite))
|
cg.add(var.set_warm_white(wwhite))
|
||||||
cg.add(var.set_warm_white_temperature(config[CONF_COLD_WHITE_COLOR_TEMPERATURE]))
|
cg.add(var.set_warm_white_temperature(config[CONF_WARM_WHITE_COLOR_TEMPERATURE]))
|
||||||
|
|
|
@ -23,7 +23,7 @@ class RGBWWLightOutput : public light::LightOutput {
|
||||||
traits.set_supports_rgb_white_value(true);
|
traits.set_supports_rgb_white_value(true);
|
||||||
traits.set_supports_color_temperature(true);
|
traits.set_supports_color_temperature(true);
|
||||||
traits.set_min_mireds(this->cold_white_temperature_);
|
traits.set_min_mireds(this->cold_white_temperature_);
|
||||||
traits.set_min_mireds(this->warm_white_temperature_);
|
traits.set_max_mireds(this->warm_white_temperature_);
|
||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
void write_state(light::LightState *state) override {
|
void write_state(light::LightState *state) override {
|
||||||
|
|
Loading…
Reference in a new issue