ESPHome  2024.11.1
monochromatic_light_output.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace monochromatic {
9 
11  public:
12  void set_output(output::FloatOutput *output) { output_ = output; }
14  auto traits = light::LightTraits();
15  traits.set_supported_color_modes({light::ColorMode::BRIGHTNESS});
16  return traits;
17  }
19  float bright;
20  state->current_values_as_brightness(&bright);
21  this->output_->set_level(bright);
22  }
23 
24  protected:
26 };
27 
28 } // namespace monochromatic
29 } // namespace esphome
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition: light_state.h:63
Interface to write LightStates to hardware.
Definition: light_output.h:12
Base class for all output components that can output a variable level, like PWM.
Definition: float_output.h:31
void set_level(float state)
Set the level of this float output, this is called from the front-end.
void current_values_as_brightness(float *brightness)
Master brightness of the light can be controlled.
This class is used to represent the capabilities of a light.
Definition: light_traits.h:11
void write_state(light::LightState *state) override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool state
Definition: fan.h:34