ESPHome  1.15.3
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::output::BinaryOutput Class Referenceabstract

#include <binary_output.h>

Inheritance diagram for esphome::output::BinaryOutput:
esphome::gpio::GPIOBinaryOutput esphome::output::FloatOutput esphome::template_::TemplateBinaryOutput esphome::ac_dimmer::AcDimmer esphome::esp32_dac::ESP32DAC esphome::esp8266_pwm::ESP8266PWM esphome::ledc::LEDCOutput esphome::my9231::MY9231OutputComponent::Channel esphome::pca9685::PCA9685Channel esphome::pid::PIDSimulator esphome::slow_pwm::SlowPWMOutput esphome::sm16716::SM16716::Channel esphome::sx1509::SX1509FloatOutputChannel esphome::template_::TemplateFloatOutput esphome::tlc59208f::TLC59208FChannel

Public Member Functions

void set_inverted (bool inverted)
 Set the inversion state of this binary output. More...
 
void set_power_supply (power_supply::PowerSupply *power_supply)
 Use this to connect up a power supply to this output. More...
 
virtual void turn_on ()
 Enable this binary output. More...
 
virtual void turn_off ()
 Disable this binary output. More...
 
bool is_inverted () const
 Return whether this binary output is inverted. More...
 

Protected Member Functions

virtual void write_state (bool state)=0
 

Protected Attributes

bool inverted_ {false}
 
power_supply::PowerSupplyRequester power_ {}
 

Detailed Description

Definition at line 18 of file binary_output.h.

Member Function Documentation

◆ is_inverted()

bool esphome::output::BinaryOutput::is_inverted ( ) const
inline

Return whether this binary output is inverted.

Definition at line 52 of file binary_output.h.

◆ set_inverted()

void esphome::output::BinaryOutput::set_inverted ( bool  inverted)
inline

Set the inversion state of this binary output.

Definition at line 21 of file binary_output.h.

◆ set_power_supply()

void esphome::output::BinaryOutput::set_power_supply ( power_supply::PowerSupply power_supply)
inline

Use this to connect up a power supply to this output.

Whenever this output is enabled, the power supply will automatically be turned on.

Parameters
power_supplyThe PowerSupplyComponent, set this to nullptr to disable the power supply.

Definition at line 30 of file binary_output.h.

◆ turn_off()

virtual void esphome::output::BinaryOutput::turn_off ( )
inlinevirtual

Disable this binary output.

Definition at line 42 of file binary_output.h.

◆ turn_on()

virtual void esphome::output::BinaryOutput::turn_on ( )
inlinevirtual

Enable this binary output.

Definition at line 34 of file binary_output.h.

◆ write_state()

virtual void esphome::output::BinaryOutput::write_state ( bool  state)
protectedpure virtual

Field Documentation

◆ inverted_

bool esphome::output::BinaryOutput::inverted_ {false}
protected

Definition at line 57 of file binary_output.h.

◆ power_

power_supply::PowerSupplyRequester esphome::output::BinaryOutput::power_ {}
protected

Definition at line 59 of file binary_output.h.


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