ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
esphome::output::ApplyBinaryOutput< Fn > Class Template Referencefinal

Calls the codegen-generated Fn(this, index, state) on a state write; the hub is baked into Fn. More...

#include <binary_output.h>

Inheritance diagram for esphome::output::ApplyBinaryOutput< Fn >:
esphome::output::BinaryOutput

Public Member Functions

 ApplyBinaryOutput (uint16_t index=0)
 
- Public Member Functions inherited from esphome::output::BinaryOutput
void set_inverted (bool inverted)
 Set the inversion state of this binary output.
 
void set_power_supply (power_supply::PowerSupply *power_supply)
 Use this to connect up a power supply to this output.
 
virtual void set_state (bool state)
 Enable or disable this binary output.
 
virtual void turn_on ()
 Enable this binary output.
 
virtual void turn_off ()
 Disable this binary output.
 
bool is_inverted () const
 Return whether this binary output is inverted.
 

Protected Member Functions

void write_state (bool state) override
 
- Protected Member Functions inherited from esphome::output::BinaryOutput

Protected Attributes

uint16_t index_
 
- Protected Attributes inherited from esphome::output::BinaryOutput
bool inverted_ {false}
 
power_supply::PowerSupplyRequester power_ {}
 

Detailed Description

template<auto Fn>
class esphome::output::ApplyBinaryOutput< Fn >

Calls the codegen-generated Fn(this, index, state) on a state write; the hub is baked into Fn.

The index (a hub's channel) is data, so all channels of a hub share one instantiation.

Definition at line 73 of file binary_output.h.

Constructor & Destructor Documentation

◆ ApplyBinaryOutput()

template<auto Fn>
esphome::output::ApplyBinaryOutput< Fn >::ApplyBinaryOutput ( uint16_t index = 0)
inlineexplicit

Definition at line 75 of file binary_output.h.

Member Function Documentation

◆ write_state()

template<auto Fn>
void esphome::output::ApplyBinaryOutput< Fn >::write_state ( bool state)
inlineoverrideprotectedvirtual

Implements esphome::output::BinaryOutput.

Definition at line 78 of file binary_output.h.

Field Documentation

◆ index_

template<auto Fn>
uint16_t esphome::output::ApplyBinaryOutput< Fn >::index_
protected

Definition at line 80 of file binary_output.h.


The documentation for this class was generated from the following file: