ESPHome 2026.5.1
Loading...
Searching...
No Matches
cwww_light_output.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::cwww {
8
10 public:
11 void set_cold_white(output::FloatOutput *cold_white) { cold_white_ = cold_white; }
12 void set_warm_white(output::FloatOutput *warm_white) { warm_white_ = warm_white; }
13 void set_cold_white_temperature(float cold_white_temperature) { cold_white_temperature_ = cold_white_temperature; }
14 void set_warm_white_temperature(float warm_white_temperature) { warm_white_temperature_ = warm_white_temperature; }
15 void set_constant_brightness(bool constant_brightness) { constant_brightness_ = constant_brightness; }
17 auto traits = light::LightTraits();
18 traits.set_supported_color_modes({light::ColorMode::COLD_WARM_WHITE});
19 traits.set_min_mireds(this->cold_white_temperature_);
20 traits.set_max_mireds(this->warm_white_temperature_);
21 return traits;
22 }
24 float cwhite, wwhite;
25 state->current_values_as_cwww(&cwhite, &wwhite, this->constant_brightness_);
26 this->cold_white_->set_level(cwhite);
27 this->warm_white_->set_level(wwhite);
28 }
29
30 protected:
36};
37
38} // namespace esphome::cwww
void set_constant_brightness(bool constant_brightness)
void write_state(light::LightState *state) override
void set_cold_white(output::FloatOutput *cold_white)
void set_warm_white_temperature(float warm_white_temperature)
light::LightTraits get_traits() override
void set_warm_white(output::FloatOutput *warm_white)
output::FloatOutput * warm_white_
output::FloatOutput * cold_white_
void set_cold_white_temperature(float cold_white_temperature)
Interface to write LightStates to hardware.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:93
This class is used to represent the capabilities of a light.
Definition light_traits.h:9
Base class for all output components that can output a variable level, like PWM.
void set_level(float state)
Set the level of this float output, this is called from the front-end.
bool state
Definition fan.h:2
@ COLD_WARM_WHITE
Cold and warm white output with individually controllable brightness.