mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 06:04:01 +00:00
RGBWW - added channel interlock for RGB vs white (#1042)
* Update light_color_values.h * Update light_color_values.h * Update light_color_values.h * Update light_color_values.h * colour relative to white value * Update light_state.cpp * Update light_state.cpp * Update light_state.cpp * Update light_state.cpp * Update light_color_values.h * Update light_state.cpp * linting * Update light_state.cpp * Update light_color_values.h * more lint * more lint * Update light_state.cpp * Update light_state.cpp * Update light_state.cpp * add optional interlock * Update test1.yaml * Update light_state.cpp * Update light_state.h * interlock * optional interlock. * interlock as trait * color interlock as trait * optional color interlock.... * optional color interlock * Update light_color_values.h * Lint checks.... * making travis happy * making sure gamma_correct fix is included * Update light_color_values.h * making travis happy * clang-format * Code tidy * Update light_color_values.h * Update light_color_values.h
This commit is contained in:
@@ -12,6 +12,7 @@ class RGBLightOutput : public light::LightOutput {
|
||||
void set_red(output::FloatOutput *red) { red_ = red; }
|
||||
void set_green(output::FloatOutput *green) { green_ = green; }
|
||||
void set_blue(output::FloatOutput *blue) { blue_ = blue; }
|
||||
|
||||
light::LightTraits get_traits() override {
|
||||
auto traits = light::LightTraits();
|
||||
traits.set_supports_brightness(true);
|
||||
@@ -20,7 +21,7 @@ class RGBLightOutput : public light::LightOutput {
|
||||
}
|
||||
void write_state(light::LightState *state) override {
|
||||
float red, green, blue;
|
||||
state->current_values_as_rgb(&red, &green, &blue);
|
||||
state->current_values_as_rgb(&red, &green, &blue, false);
|
||||
this->red_->set_level(red);
|
||||
this->green_->set_level(green);
|
||||
this->blue_->set_level(blue);
|
||||
|
||||
Reference in New Issue
Block a user