ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
binary_light_output.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::binary {
8
10 public:
11 void set_output(output::BinaryOutput *output) { output_ = output; }
13 auto traits = light::LightTraits();
14 traits.set_supported_color_modes({light::ColorMode::ON_OFF});
15 return traits;
16 }
18 bool binary;
19 state->current_values_as_binary(&binary);
20 this->output_->set_state(binary);
21 }
22
23 protected:
25};
26
27} // namespace esphome::binary
void set_output(output::BinaryOutput *output)
void write_state(light::LightState *state) override
light::LightTraits get_traits() override
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:68
This class is used to represent the capabilities of a light.
Definition light_traits.h:9
virtual void set_state(bool state)
Enable or disable this binary output.
bool state
Definition fan.h:2
@ ON_OFF
Only on/off control.