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

#include <binary_output.h>

Inheritance diagram for esphome::output::BinaryOutput:
esphome::ble_client::BLEBinaryOutput esphome::gpio::GPIOBinaryOutput esphome::modbus_controller::ModbusBinaryOutput esphome::output::FloatOutput esphome::template_::TemplateBinaryOutput esphome::tm1638::TM1638OutputLed esphome::ac_dimmer::AcDimmer esphome::bp1658cj::BP1658CJ::Channel esphome::bp5758d::BP5758D::Channel esphome::dac7678::DAC7678Channel esphome::emc2101::EMC2101Output esphome::esp32_dac::ESP32DAC esphome::esp8266_pwm::ESP8266PWM esphome::gp8403::GP8403Output esphome::ledc::LEDCOutput esphome::libretiny_pwm::LibreTinyPWM esphome::max6956::MAX6956LedChannel esphome::mcp4725::MCP4725 esphome::mcp4728::MCP4728Channel esphome::mcp47a1::MCP47A1 esphome::modbus_controller::ModbusFloatOutput esphome::my9231::MY9231OutputComponent::Channel esphome::opentherm::OpenthermOutput esphome::pca9685::PCA9685Channel esphome::pid::PIDSimulator esphome::pipsolar::PipsolarOutput esphome::rp2040_pwm::RP2040PWM esphome::sigma_delta_output::SigmaDeltaOutput esphome::slow_pwm::SlowPWMOutput esphome::sm10bit_base::Sm10BitBase::Channel esphome::sm16716::SM16716::Channel esphome::sm2135::SM2135::Channel esphome::sx1509::SX1509FloatOutputChannel esphome::template_::TemplateFloatOutput esphome::tlc59208f::TLC59208FChannel esphome::tlc5947::TLC5947Channel esphome::tlc5971::TLC5971Channel esphome::x9c::X9cOutput

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 set_state (bool state)
 Enable or disable this binary 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 61 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.

◆ set_state()

virtual void esphome::output::BinaryOutput::set_state ( bool  state)
inlinevirtual

Enable or disable this binary output.

Definition at line 34 of file binary_output.h.

◆ turn_off()

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

Disable this binary output.

Definition at line 51 of file binary_output.h.

◆ turn_on()

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

Enable this binary output.

Definition at line 43 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 66 of file binary_output.h.

◆ power_

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

Definition at line 68 of file binary_output.h.


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