ESPHome 2025.5.0
Loading...
Searching...
No Matches
cwww_light_output.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace cwww {
9
11 public:
12 void set_cold_white(output::FloatOutput *cold_white) { cold_white_ = cold_white; }
13 void set_warm_white(output::FloatOutput *warm_white) { warm_white_ = warm_white; }
14 void set_cold_white_temperature(float cold_white_temperature) { cold_white_temperature_ = cold_white_temperature; }
15 void set_warm_white_temperature(float warm_white_temperature) { warm_white_temperature_ = warm_white_temperature; }
16 void set_constant_brightness(bool constant_brightness) { constant_brightness_ = constant_brightness; }
18 auto traits = light::LightTraits();
19 traits.set_supported_color_modes({light::ColorMode::COLD_WARM_WHITE});
20 traits.set_min_mireds(this->cold_white_temperature_);
21 traits.set_max_mireds(this->warm_white_temperature_);
22 return traits;
23 }
25 float cwhite, wwhite;
26 state->current_values_as_cwww(&cwhite, &wwhite, this->constant_brightness_);
27 this->cold_white_->set_level(cwhite);
28 this->warm_white_->set_level(wwhite);
29 }
30
31 protected:
37};
38
39} // namespace cwww
40} // namespace esphome
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:63
This class is used to represent the capabilities of a light.
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:0
@ COLD_WARM_WHITE
Cold and warm white output with individually controllable brightness.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7