ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
light_output.h
Go to the documentation of this file.
1#pragma once
2
4#include "light_traits.h"
5#include "light_state.h"
6#include "light_transformer.h"
7
8namespace esphome::light {
9
12 public:
14 virtual LightTraits get_traits() = 0;
15
17 virtual std::unique_ptr<LightTransformer> create_default_transition();
18
19 virtual void setup_state(LightState *state) {}
20
23 virtual void update_state(LightState *state) {}
24
28 virtual void write_state(LightState *state) = 0;
29};
30
31} // namespace esphome::light
Interface to write LightStates to hardware.
virtual void write_state(LightState *state)=0
Called from loop() every time the light state has changed, and should should write the new state to h...
virtual std::unique_ptr< LightTransformer > create_default_transition()
Return the default transformer used for transitions.
virtual LightTraits get_traits()=0
Return the LightTraits of this LightOutput.
virtual void update_state(LightState *state)
Called on every update of the current values of the associated LightState, can optionally be used to ...
virtual void setup_state(LightState *state)
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:91
This class is used to represent the capabilities of a light.
bool state
Definition fan.h:0