13 #ifdef USE_POWER_SUPPLY 20 using ESPColor
ESPDEPRECATED(
"esphome::light::ESPColor is deprecated, use esphome::Color instead.",
"v1.21") =
Color;
33 virtual int32_t size()
const = 0;
36 virtual void clear_effect_data() = 0;
47 this->shift_right(-amnt);
50 if (amnt > this->size())
52 this->range(0, -amnt) = this->range(amnt, this->size());
56 this->shift_left(-amnt);
59 if (amnt > this->size())
61 this->range(amnt, this->size()) = this->range(0, -amnt);
66 std::unique_ptr<LightTransformer> create_default_transition()
override;
67 void set_correction(
float red,
float green,
float blue,
float white = 1.0f) {
68 this->correction_.set_max_brightness(
69 Color(to_uint8_scale(red), to_uint8_scale(green), to_uint8_scale(blue), to_uint8_scale(white)));
73 this->state_parent_ =
state;
78 #ifdef USE_POWER_SUPPLY 88 #ifdef USE_POWER_SUPPLY 89 for (
const auto &c : *
this) {
90 if (c.get_red_raw() > 0 || c.get_green_raw() > 0 || c.get_blue_raw() > 0 || c.get_white_raw() > 0) {
91 this->power_.request();
95 this->power_.unrequest();
98 virtual ESPColorView get_view_internal(int32_t index)
const = 0;
100 bool effect_active_{
false};
102 #ifdef USE_POWER_SUPPLY 112 void start()
override;
118 float last_transition_progress_{0.0f};
119 float accumulated_alpha_{0.0f};
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Interface to write LightStates to hardware.
float get_gamma_correct() const
void set_effect_active(bool effect_active)
void apply(Climate *climate)
Apply these settings to the climate device.
power_supply::PowerSupplyRequester power_
void shift_left(int32_t amnt)
void set_power_supply(power_supply::PowerSupply *power_supply)
int32_t HOT interpret_index(int32_t index, int32_t size)
virtual void call_setup()
LightState(LightOutput *output)
This class represents the color state for a light object.
ESPDEPRECATED("Use Color::BLACK instead of COLOR_BLACK", "v1.21") extern const Color COLOR_BLACK
bool is_effect_active() const
ESPColorView operator[](int32_t index) const
Color color_from_light_color_values(LightColorValues val)
Convert the color information from a LightColorValues object to a Color object (does not apply bright...
void set_correction(float red, float green, float blue, float white=1.0f)
Implementation of SPI Controller mode.
A half-open range of LEDs, inclusive of the begin index and exclusive of the end index, using zero-based numbering.
void setup_state(LightState *state) override
void shift_right(int32_t amnt)
Use a custom state class for addressable lights, to allow type system to discriminate between address...
ESPRangeView range(int32_t from, int32_t to)