|
ESPHome 2026.8.0-dev
|
#include <component.h>
Public Member Functions | |
| virtual void | setup () |
| Where the component's initialization should happen. | |
| virtual void | loop () |
| This method will be called repeatedly. | |
| virtual void | dump_config () |
| virtual float | get_setup_priority () const |
| priority of setup(). | |
| float | get_actual_setup_priority () const |
| void | set_setup_priority (float priority) |
| void | call () |
| virtual void | on_shutdown () |
| virtual void | on_safe_shutdown () |
| virtual bool | teardown () |
| Called during teardown to allow component to gracefully finish operations. | |
| virtual void | on_powerdown () |
| Called after teardown is complete to power down hardware. | |
| uint8_t | get_component_state () const |
| void | reset_to_construction_state () |
| Reset this component back to the construction state to allow setup to run again. | |
| bool | is_in_loop_state () const |
| Check if this component has completed setup and is in the loop state. | |
| bool | is_idle () const |
| Check if this component is idle. | |
| void | mark_failed () |
| Mark this component as failed. | |
| void | mark_failed (const LogString *message) |
| void | disable_loop () |
| Disable this component's loop. | |
| void | enable_loop () |
| Enable this component's loop. | |
| void | enable_loop_soon_any_context () |
| Thread and ISR-safe version of enable_loop() that can be called from any context. | |
| bool | is_failed () const |
| bool | is_ready () const |
| virtual bool | can_proceed () |
| bool | status_has_warning () const |
| bool | status_has_error () const |
| void | status_set_warning () |
| void | status_set_warning (const char *message) |
| void | status_set_warning (const LogString *message) |
| void | status_set_error () |
| void | status_set_error (const LogString *message) |
| void | status_clear_warning () |
| void | status_clear_error () |
| void | status_momentary_warning (const char *name, uint32_t length=5000) |
| Set warning status flag and automatically clear it after a timeout. | |
| void | status_momentary_error (const char *name, uint32_t length=5000) |
| Set error status flag and automatically clear it after a timeout. | |
| bool | has_overridden_loop () const |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| Get the integration where this component was declared as a LogString for logging. | |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
Protected Member Functions | |
| friend | void::setup () |
| friend | void::original_setup () |
| void | set_component_source_ (uint8_t index) |
| Set where this component was loaded from for some debug messages. | |
| virtual void | call_setup () |
| void | call_dump_config_ () |
| void | enable_loop_slow_path_ () |
| void | set_component_state_ (uint8_t state) |
| Helper to set component state (clears state bits and sets new state) | |
| bool | set_status_flag_ (uint8_t flag) |
| Helper to set a status LED flag on both this component and the app. | |
| void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a const char* name. | |
| void | set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a numeric ID (zero heap allocation). | |
| void | set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f) |
| void | set_interval (uint32_t interval, std::function< void()> &&f) |
| bool | cancel_interval (const char *name) |
| Cancel an interval function. | |
| bool | cancel_interval (uint32_t id) |
| bool | cancel_interval (InternalSchedulerID id) |
| void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a const char* name. | |
| void | set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a numeric ID (zero heap allocation). | |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f) |
| void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
| bool | cancel_timeout (const char *name) |
| Cancel a timeout function. | |
| bool | cancel_timeout (uint32_t id) |
| bool | cancel_timeout (InternalSchedulerID id) |
| void | defer (const char *name, std::function< void()> &&f) |
| Defer a callback to the next loop() call with a const char* name. | |
| void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. | |
| void | defer (uint32_t id, std::function< void()> &&f) |
| Defer a callback with a numeric ID (zero heap allocation) | |
| bool | cancel_defer (const char *name) |
| Cancel a defer callback using the specified name, name must not be empty. | |
| bool | cancel_defer (uint32_t id) |
| void | status_clear_warning_slow_path_ () |
| void | status_clear_error_slow_path_ () |
Protected Attributes | |
| uint8_t | component_source_index_ {0} |
| Index into component source PROGMEM lookup table (0 = not set) | |
| uint8_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_CS} |
| Warn threshold in centiseconds (max 2550ms) | |
| uint8_t | component_state_ {0x00} |
| State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion. | |
| volatile bool | pending_enable_loop_ {false} |
| ISR-safe flag for enable_loop_soon_any_context. | |
| ComponentRuntimeStats | runtime_stats_ |
Definition at line 145 of file component.h.
| void esphome::Component::call | ( | ) |
Definition at line 148 of file component.cpp.
|
protected |
Definition at line 130 of file component.cpp.
|
protectedvirtual |
Reimplemented in esphome::light::AddressableLight, esphome::mqtt::MQTTComponent, esphome::PollingComponent, and esphome::touchscreen::Touchscreen.
Definition at line 129 of file component.cpp.
|
virtual |
Reimplemented in esphome::cst226::CST226Touchscreen, esphome::esp32_ble_server::BLEServer, esphome::gt911::GT911Touchscreen, esphome::midea::ApplianceBase< T >, esphome::midea::ApplianceBase< dudanov::midea::ac::AirConditioner >, esphome::mqtt::MQTTClientComponent, esphome::qspi_dbi::QspiDbi, esphome::wireguard::Wireguard, and esphome::zwave_proxy::ZWaveProxy.
Definition at line 271 of file component.cpp.
|
protected |
Cancel a defer callback using the specified name, name must not be empty.
Definition at line 249 of file component.cpp.
|
protected |
Definition at line 258 of file component.cpp.
|
protected |
Cancel an interval function.
| name | The identifier for this interval function. |
Definition at line 92 of file component.cpp.
|
protected |
Definition at line 127 of file component.cpp.
|
protected |
Definition at line 121 of file component.cpp.
|
protected |
Cancel a timeout function.
| name | The identifier for this timeout function. |
Definition at line 100 of file component.cpp.
|
protected |
Definition at line 115 of file component.cpp.
|
protected |
Definition at line 109 of file component.cpp.
|
protected |
Defer a callback to the next loop() call with a const char* name.
If name is specified and a defer() object with the same name exists, the old one is first removed.
IMPORTANT: The provided name pointer must remain valid for the lifetime of the deferred task. This means the name should be:
For dynamic names, use the uint32_t id overload instead.
| name | The name of the defer function (must have static lifetime) |
| f | The callback |
Definition at line 252 of file component.cpp.
|
protected |
Defer a callback to the next loop() call.
Definition at line 246 of file component.cpp.
|
protected |
Defer a callback with a numeric ID (zero heap allocation)
Definition at line 255 of file component.cpp.
| void esphome::Component::disable_loop | ( | ) |
Disable this component's loop.
The loop() method will no longer be called.
This is useful for components that only need to run for a certain period of time or when inactive, saving CPU cycles.
Definition at line 210 of file component.cpp.
|
virtual |
Reimplemented in esphome::a01nyub::A01nyubComponent, esphome::a02yyuw::A02yyuwComponent, esphome::a4988::A4988, esphome::absolute_humidity::AbsoluteHumidityComponent, esphome::ac_dimmer::AcDimmer, esphome::adc128s102::ADC128S102, esphome::adc128s102::ADC128S102Sensor, esphome::adc::ADCSensor, esphome::ade7880::ADE7880, esphome::ade7953_base::ADE7953, esphome::ade7953_i2c::AdE7953I2c, esphome::ade7953_spi::AdE7953Spi, esphome::ads1115::ADS1115Component, esphome::ads1115::ADS1115Sensor, esphome::ads1118::ADS1118, esphome::ads1118::ADS1118Sensor, esphome::ags10::AGS10Component, esphome::aht10::AHT10Component, esphome::aic3204::AIC3204, esphome::airthings_wave_mini::AirthingsWaveMini, esphome::airthings_wave_plus::AirthingsWavePlus, esphome::alpha3::Alpha3, esphome::am2315c::AM2315C, esphome::am2320::AM2320Component, esphome::am43::Am43, esphome::am43::Am43Component, esphome::analog_threshold::AnalogThresholdBinarySensor, esphome::anova::Anova, esphome::apds9306::APDS9306, esphome::api::APIServer, esphome::aqi::AQISensor, esphome::as3935_i2c::I2CAS3935Component, esphome::as3935_spi::SPIAS3935Component, esphome::as5600::AS5600Component, esphome::as5600::AS5600Sensor, esphome::as7341::AS7341Component, esphome::at581x::AT581XComponent, esphome::atc_mithermometer::ATCMiThermometer, esphome::atm90e26::ATM90E26Component, esphome::atm90e32::ATM90E32Component, esphome::audio_file::AudioFileMediaSource, esphome::audio_http::AudioHTTPMediaSource, esphome::axs15231::AXS15231Touchscreen, esphome::b_parasite::BParasite, esphome::bang_bang::BangBangClimate, esphome::bedjet::BedJetClimate, esphome::bedjet::BedJetFan, esphome::bedjet::BedJetHub, esphome::bedjet::BedjetSensor, esphome::beken_spi_led_strip::BekenSPILEDStripLightOutput, esphome::bh1750::BH1750Sensor, esphome::bh1900nux::BH1900NUXSensor, esphome::binary::BinaryFan, esphome::binary_sensor_map::BinarySensorMap, esphome::bk72xx_ble::BK72xxBLE, esphome::bl0939::BL0939, esphome::bl0940::BL0940, esphome::bl0940::CalibrationNumber, esphome::bl0940::CalibrationResetButton, esphome::bl0942::BL0942, esphome::ble_client::BLEBinaryOutput, esphome::ble_client::BLEClient, esphome::ble_client::BLEClientRSSISensor, esphome::ble_client::BLEClientSwitch, esphome::ble_client::BLESensor, esphome::ble_client::BLETextSensor, esphome::ble_nus::BLENUS, esphome::ble_presence::BLEPresenceDevice, esphome::ble_rssi::BLERSSISensor, esphome::ble_scanner::BLEScanner, esphome::bluetooth_proxy::BluetoothConnection, esphome::bluetooth_proxy::BluetoothProxy, esphome::bm8563::BM8563, esphome::bme280_base::BME280Component, esphome::bme680::BME680Component, esphome::bme680_bsec::BME680BSECComponent, esphome::bme68x_bsec2::BME68xBSEC2Component, esphome::bmi160::BMI160Component, esphome::bmi270::BMI270Component, esphome::bmp085::BMP085Component, esphome::bmp280_base::BMP280Component, esphome::bmp280_i2c::BMP280I2CComponent, esphome::bmp3xx_base::BMP3XXComponent, esphome::bmp581_base::BMP581Component, esphome::bmp581_i2c::BMP581I2CComponent, esphome::bmp581_spi::BMP581SPIComponent, esphome::bp1658cj::BP1658CJ, esphome::bp5758d::BP5758D, esphome::bthome_mithermometer::BTHomeMiThermometer, esphome::canbus::Canbus, esphome::cap1188::CAP1188Component, esphome::captive_portal::CaptivePortal, esphome::cc1101::CC1101Component, esphome::ccs811::CCS811Component, esphome::cd74hc4067::CD74HC4067Component, esphome::cd74hc4067::CD74HC4067Sensor, esphome::ch422g::CH422GComponent, esphome::ch423::CH423Component, esphome::chsc6x::CHSC6XTouchscreen, esphome::climate_ir::ClimateIR, esphome::cm1106::CM1106Component, esphome::combination::KalmanCombinationComponent, esphome::combination::LinearCombinationComponent, esphome::combination::MaximumCombinationComponent, esphome::combination::MeanCombinationComponent, esphome::combination::MedianCombinationComponent, esphome::combination::MinimumCombinationComponent, esphome::combination::MostRecentCombinationComponent, esphome::combination::RangeCombinationComponent, esphome::combination::SumCombinationComponent, esphome::copy::CopyBinarySensor, esphome::copy::CopyButton, esphome::copy::CopyCover, esphome::copy::CopyFan, esphome::copy::CopyLock, esphome::copy::CopyNumber, esphome::copy::CopySelect, esphome::copy::CopySensor, esphome::copy::CopySwitch, esphome::copy::CopyText, esphome::copy::CopyTextSensor, esphome::cs5460a::CS5460AComponent, esphome::cse7761::CSE7761Component, esphome::cse7766::CSE7766Component, esphome::cst226::CST226Button, esphome::cst226::CST226Touchscreen, esphome::cst328::CST328Button, esphome::cst328::CST328Touchscreen, esphome::cst816::CST816Touchscreen, esphome::cst9220::CST9220Touchscreen, esphome::ct_clamp::CTClampSensor, esphome::current_based::CurrentBasedCover, esphome::dac7678::DAC7678Output, esphome::dallas_temp::DallasTemperatureSensor, esphome::daly_bms::DalyBmsComponent, esphome::debug::DebugComponent, esphome::deep_sleep::DeepSleepComponent, esphome::dew_point::DewPointComponent, esphome::dfplayer::DFPlayer, esphome::dht12::DHT12Component, esphome::dht::DHT, esphome::dlms_meter::DlmsMeterComponent, esphome::dps310::DPS310Component, esphome::ds1307::DS1307Component, esphome::ds2484::DS2484OneWireBus, esphome::ds248x::DS248xComponent, esphome::ds248x::DS248xOneWireBus, esphome::dsmr::Dsmr, esphome::duty_cycle::DutyCycleSensor, esphome::duty_time_sensor::DutyTimeSensor, esphome::ee895::EE895Component, esphome::ektf2232::EKTF2232Touchscreen, esphome::emc2101::Emc2101Component, esphome::emc2101::EMC2101Sensor, esphome::emontx::EmonTx, esphome::emontx::EmonTxSensor, esphome::endstop::EndstopCover, esphome::ens160_base::ENS160Component, esphome::ens210::ENS210Component, esphome::epaper_spi::EPaperBase, esphome::epaper_spi::EPaperT133A01, esphome::es7210::ES7210, esphome::es7243e::ES7243E, esphome::es8156::ES8156, esphome::es8311::ES8311, esphome::esp32_ble::ESP32BLE, esphome::esp32_ble_beacon::ESP32BLEBeacon, esphome::esp32_ble_client::BLEClientBase, esphome::esp32_ble_server::BLEServer, esphome::esp32_ble_tracker::ESP32BLETracker, esphome::esp32_camera::ESP32Camera, esphome::esp32_camera_web_server::CameraWebServer, esphome::esp32_dac::ESP32DAC, esphome::esp32_hosted::Esp32HostedUpdate, esphome::esp32_improv::ESP32ImprovComponent, esphome::esp32_rmt_led_strip::ESP32RMTLEDStripLightOutput, esphome::esp32_touch::ESP32TouchComponent, esphome::esp8266_pwm::ESP8266PWM, esphome::esp_ldo::EspLdo, esphome::ESPHomeOTAComponent, esphome::espnow::ESPNowComponent, esphome::ethernet::EthernetComponent, esphome::ethernet_info::DNSAddressEthernetInfo, esphome::ethernet_info::IPAddressEthernetInfo, esphome::ethernet_info::MACAddressEthernetInfo, esphome::ezo::EZOSensor, esphome::ezo_pmp::EzoPMP, esphome::factory_reset::FactoryResetButton, esphome::factory_reset::FactoryResetComponent, esphome::factory_reset::FactoryResetSwitch, esphome::fastled_base::FastLEDLightOutput, esphome::feedback::FeedbackCover, esphome::fingerprint_grow::FingerprintGrowComponent, esphome::fs3000::FS3000Component, esphome::ft5x06::FT5x06Touchscreen, esphome::ft63x6::FT63X6Touchscreen, esphome::gcja5::GCJA5Component, esphome::gl_r01_i2c::GLR01I2CComponent, esphome::gp2y1010au0f::GP2Y1010AU0FSensor, esphome::gp8403::GP8403Component, esphome::gp8403::GP8403Output, esphome::gpio::GPIOBinaryOutput, esphome::gpio::GPIOBinarySensor, esphome::gpio::GPIOOneWireBus, esphome::gpio::GPIOSwitch, esphome::gps::GPS, esphome::graph::Graph, esphome::graphical_display_menu::GraphicalDisplayMenu, esphome::gree::GreeModeBitSwitch, esphome::grove_tb6612fng::GroveMotorDriveTB6612FNG, esphome::growatt_solar::GrowattSolar, esphome::gsl3670::GSL3670Touchscreen, esphome::gt911::GT911Button, esphome::gt911::GT911Touchscreen, esphome::haier::HaierClimateBase, esphome::haier::HonClimate, esphome::haier::Smartair2Climate, esphome::havells_solar::HavellsSolar, esphome::hbridge::HBridgeFan, esphome::hbridge::HBridgeSwitch, esphome::hc8::HC8Component, esphome::hdc1080::HDC1080Component, esphome::hdc2010::HDC2010Component, esphome::hdc2080::HDC2080Component, esphome::hdc302x::HDC302XComponent, esphome::he60r::HE60rCover, esphome::hlk_fm22x::HlkFm22xComponent, esphome::hlw8012::HLW8012Component, esphome::hlw8032::HLW8032Component, esphome::hm3301::HM3301Component, esphome::hmc5883l::HMC5883LComponent, esphome::homeassistant::HomeassistantBinarySensor, esphome::homeassistant::HomeassistantNumber, esphome::homeassistant::HomeassistantSensor, esphome::homeassistant::HomeassistantSwitch, esphome::homeassistant::HomeassistantTextSensor, esphome::homeassistant::HomeassistantTime, esphome::honeywell_hih_i2c::HoneywellHIComponent, esphome::honeywellabp2_i2c::HONEYWELLABP2Sensor, esphome::honeywellabp::HONEYWELLABPSensor, esphome::hrxl_maxsonar_wr::HrxlMaxsonarWrComponent, esphome::hte501::HTE501Component, esphome::http_request::HttpRequestComponent, esphome::http_request::HttpRequestIDF, esphome::http_request::OtaHttpRequestComponent, esphome::htu21d::HTU21DComponent, esphome::htu31d::HTU31DComponent, esphome::hub75::HUB75Display, esphome::hx711::HX711Sensor, esphome::hydreon_rgxx::HydreonRGxxComponent, esphome::hyt271::HYT271Component, esphome::i2c::ArduinoI2CBus, esphome::i2c::HostI2CBus, esphome::i2c::IDFI2CBus, esphome::i2c::ZephyrI2CBus, esphome::i2c_device::I2CDeviceComponent, esphome::i2s_audio::I2SAudioMicrophone, esphome::i2s_audio::I2SAudioSpeaker, esphome::i2s_audio::I2SAudioSpeakerBase, esphome::i2s_audio::I2SAudioSpeakerSPDIF, esphome::iaqcore::IAQCore, esphome::ili9xxx::ILI9XXXDisplay, esphome::improv_serial::ImprovSerialComponent, esphome::ina219::INA219Component, esphome::ina226::INA226Component, esphome::ina260::INA260Component, esphome::ina2xx_base::INA2XX, esphome::ina2xx_i2c::INA2XXI2C, esphome::ina2xx_spi::INA2XXSPI, esphome::ina3221::INA3221Component, esphome::infrared::Infrared, esphome::inkbird_ibsth1_mini::InkbirdIbstH1Mini, esphome::inkplate::Inkplate, esphome::integration::IntegrationSensor, esphome::internal_temperature::InternalTemperatureSensor, esphome::ir_rf_proxy::IrRfProxy, esphome::ir_rf_proxy::RfProxy, esphome::it8951::IT8951Display, esphome::jsn_sr04t::Jsnsr04tComponent, esphome::kamstrup_kmp::KamstrupKMPComponent, esphome::key_collector::KeyCollector, esphome::kuntze::Kuntze, esphome::lc709203f::Lc709203f, esphome::lcd_gpio::GPIOLCDDisplay, esphome::lcd_menu::LCDCharacterMenuComponent, esphome::lcd_pcf8574::PCF8574LCDDisplay, esphome::ld2420::LD2420BinarySensor, esphome::ld2420::LD2420Component, esphome::ld2420::LD2420Sensor, esphome::ld2420::LD2420TextSensor, esphome::ledc::LEDCOutput, esphome::libretiny::LTComponent, esphome::libretiny_pwm::LibreTinyPWM, esphome::light::LightState, esphome::lightwaverf::LightWaveRF, esphome::lilygo_t5_47::LilygoT547Touchscreen, esphome::lm75b::LM75BComponent, esphome::logger::Logger, esphome::lps22::LPS22Component, esphome::lsm6ds::LSM6DSComponent, esphome::ltr390::LTR390Component, esphome::ltr501::LTRAlsPs501Component, esphome::ltr_als_ps::LTRAlsPsComponent, esphome::lvgl::LvglComponent, esphome::m5stack_8angle::M5Stack8AngleComponent, esphome::matrix_keypad::MatrixKeypad, esphome::max17043::MAX17043Component, esphome::max31855::MAX31855Sensor, esphome::max31856::MAX31856Sensor, esphome::max31865::MAX31865Sensor, esphome::max44009::MAX44009Sensor, esphome::max6675::MAX6675Sensor, esphome::max6956::MAX6956, esphome::max6956::MAX6956LedChannel, esphome::max7219::MAX7219Component, esphome::max7219digit::MAX7219Component, esphome::max9611::MAX9611Component, esphome::mcp23008::MCP23008, esphome::mcp23017::MCP23017, esphome::mcp23s08::MCP23S08, esphome::mcp23s17::MCP23S17, esphome::mcp3008::MCP3008, esphome::mcp3008::MCP3008Sensor, esphome::mcp3204::MCP3204, esphome::mcp3204::MCP3204Sensor, esphome::mcp4461::Mcp4461Component, esphome::mcp4725::MCP4725, esphome::mcp4728::MCP4728Component, esphome::mcp47a1::MCP47A1, esphome::mcp9600::MCP9600Component, esphome::mcp9808::MCP9808Sensor, esphome::mdns::MDNSComponent, esphome::mhz19::MHZ19Component, esphome::micro_wake_word::MicroWakeWord, esphome::micronova::MicroNova, esphome::micronova::MicroNovaButton, esphome::micronova::MicroNovaNumber, esphome::micronova::MicroNovaSensor, esphome::micronova::MicroNovaSwitch, esphome::micronova::MicroNovaTextSensor, esphome::midea::ac::AirConditioner, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_rgb::MipiRgbSpi, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::mipi_spi::MipiSpiBuffer< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION, FRACTION, ROUNDING >, esphome::mitsubishi_cn105::MitsubishiCN105Climate, esphome::mixer_speaker::MixerSpeaker, esphome::mixer_speaker::SourceSpeaker, esphome::mlx90393::MLX90393Cls, esphome::mlx90614::MLX90614Component, esphome::mmc5603::MMC5603Component, esphome::mmc5983::MMC5983Component, esphome::modbus::ModbusClientHub, esphome::modbus::ModbusServerHub, esphome::modbus_controller::ModbusBinaryOutput, esphome::modbus_controller::ModbusBinarySensor, esphome::modbus_controller::ModbusController, esphome::modbus_controller::ModbusFloatOutput, esphome::modbus_controller::ModbusNumber, esphome::modbus_controller::ModbusSelect, esphome::modbus_controller::ModbusSensor, esphome::modbus_controller::ModbusSwitch, esphome::modbus_controller::ModbusTextSensor, esphome::modbus_server::ModbusServer, esphome::mopeka_pro_check::MopekaProCheck, esphome::mopeka_std_check::MopekaStdCheck, esphome::motion::MotionComponent, esphome::mpl3115a2::MPL3115A2Component, esphome::mpr121::MPR121Component, esphome::mpu6050::MPU6050Component, esphome::mpu6886::MPU6886Component, esphome::mqtt::MQTTAlarmControlPanelComponent, esphome::mqtt::MQTTBinarySensorComponent, esphome::mqtt::MQTTButtonComponent, esphome::mqtt::MQTTClientComponent, esphome::mqtt::MQTTCoverComponent, esphome::mqtt::MQTTDateComponent, esphome::mqtt::MQTTDateTimeComponent, esphome::mqtt::MQTTEventComponent, esphome::mqtt::MQTTFanComponent, esphome::mqtt::MQTTJSONLightComponent, esphome::mqtt::MQTTLockComponent, esphome::mqtt::MQTTMessageTrigger, esphome::mqtt::MQTTNumberComponent, esphome::mqtt::MQTTSelectComponent, esphome::mqtt::MQTTSensorComponent, esphome::mqtt::MQTTSwitchComponent, esphome::mqtt::MQTTTextComponent, esphome::mqtt::MQTTTextSensor, esphome::mqtt::MQTTTimeComponent, esphome::mqtt::MQTTUpdateComponent, esphome::mqtt::MQTTValveComponent, esphome::mqtt_subscribe::MQTTSubscribeSensor, esphome::mqtt_subscribe::MQTTSubscribeTextSensor, esphome::ms5611::MS5611Component, esphome::ms8607::MS8607Component, esphome::msa3xx::MSA3xxComponent, esphome::my9231::MY9231OutputComponent, esphome::nau7802::NAU7802Sensor, esphome::nextion::Nextion, esphome::nfc::NfcTagBinarySensor, esphome::npi19::NPI19Component, esphome::nrf52::DeviceFirmwareUpdate, esphome::ntc::NTC, esphome::number::NumberSensor, esphome::opentherm::OpenthermHub, esphome::opentherm::OpenthermNumber, esphome::opentherm::OpenthermSwitch, esphome::openthread::OpenThreadComponent, esphome::openthread_info::ChannelOpenThreadInfo, esphome::openthread_info::Eui64OpenThreadInfo, esphome::openthread_info::ExtAddrOpenThreadInfo, esphome::openthread_info::ExtPanIdOpenThreadInfo, esphome::openthread_info::IPAddressOpenThreadInfo, esphome::openthread_info::NetworkKeyOpenThreadInfo, esphome::openthread_info::NetworkNameOpenThreadInfo, esphome::openthread_info::PanIdOpenThreadInfo, esphome::openthread_info::Rloc16OpenThreadInfo, esphome::openthread_info::RoleOpenThreadInfo, esphome::opt3001::OPT3001Sensor, esphome::output::OutputButton, esphome::output::OutputLock, esphome::output::OutputSwitch, esphome::packet_transport::PacketTransport, esphome::pca6416a::PCA6416AComponent, esphome::pca9554::PCA9554Component, esphome::pca9685::PCA9685Output, esphome::pcd8544::PCD8544, esphome::pcf85063::PCF85063Component, esphome::pcf8563::PCF8563Component, esphome::pcf8574::PCF8574Component, esphome::pcm5122::PCM5122, esphome::pi4ioe5v6408::PI4IOE5V6408Component, esphome::pid::PIDClimate, esphome::pid::PIDClimateSensor, esphome::pipsolar::PipsolarSwitch, esphome::pixoo::Pixoo, esphome::pm1006::PM1006Component, esphome::pm2005::PM2005Component, esphome::pmsa003i::PMSA003IComponent, esphome::pmsx003::PMSX003Component, esphome::pmwcs3::PMWCS3Component, esphome::pn532::PN532, esphome::pn532_i2c::PN532I2C, esphome::pn532_spi::PN532Spi, esphome::pn7150::PN7150, esphome::pn7150_i2c::PN7150I2C, esphome::pn7160::PN7160, esphome::pn7160_i2c::PN7160I2C, esphome::pn7160_spi::PN7160Spi, esphome::power_supply::PowerSupply, esphome::provisioning::ProvisioningManager, esphome::pulse_counter::PulseCounterSensor, esphome::pulse_meter::PulseMeterSensor, esphome::pulse_width::PulseWidthSensor, esphome::pvvx_mithermometer::PVVXDisplay, esphome::pvvx_mithermometer::PVVXMiThermometer, esphome::pylontech::PylontechComponent, esphome::pzem004t::PZEM004T, esphome::pzemac::PZEMAC, esphome::pzemdc::PZEMDC, esphome::qmc5883l::QMC5883LComponent, esphome::qmi8658::QMI8658Component, esphome::qmp6988::QMP6988Component, esphome::qr_code::QrCode, esphome::qspi_dbi::QspiDbi, esphome::qwiic_pir::QwiicPIRComponent, esphome::radio_frequency::RadioFrequency, esphome::radon_eye_rd200::RadonEyeRD200, esphome::rc522::RC522, esphome::rc522_i2c::RC522I2C, esphome::rc522_spi::RC522Spi, esphome::rd03d::RD03DComponent, esphome::remote_base::RemoteReceiverBinarySensorBase, esphome::remote_receiver::RemoteReceiverComponent, esphome::remote_transmitter::RemoteTransmitterComponent, esphome::resampler::ResamplerSpeaker, esphome::resistance::ResistanceSensor, esphome::restart::RestartButton, esphome::restart::RestartSwitch, esphome::rf_bridge::RFBridgeComponent, esphome::rotary_encoder::RotaryEncoderSensor, esphome::router::Router, esphome::rp2040_ble::RP2040BLE, esphome::rp2040_pio_led_strip::RP2040PIOLEDStripLightOutput, esphome::rp2040_pwm::RP2040PWM, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::rtttl::Rtttl, esphome::ruuvitag::RuuviTag, esphome::rx8130::RX8130Component, esphome::safe_mode::SafeModeButton, esphome::safe_mode::SafeModeComponent, esphome::safe_mode::SafeModeSwitch, esphome::scd30::SCD30Component, esphome::scd4x::SCD4XComponent, esphome::sdl::Sdl, esphome::sdm_meter::SDMMeter, esphome::sdp3x::SDP3XComponent, esphome::sds011::SDS011Component, esphome::seeed_mr24hpc1::MR24HPC1Component, esphome::seeed_mr60bha2::MR60BHA2Component, esphome::seeed_mr60fda2::MR60FDA2Component, esphome::selec_meter::SelecMeter, esphome::sen0321_sensor::Sen0321Sensor, esphome::sen21231_sensor::Sen21231Sensor, esphome::sen5x::SEN5XComponent, esphome::sendspin_::SendspinHub, esphome::sendspin_::SendspinMediaPlayer, esphome::sendspin_::SendspinMediaSource, esphome::sendspin_::SendspinMetadataSensor, esphome::sendspin_::SendspinTextSensor, esphome::sendspin_::SendspinTrackProgressSensor, esphome::senseair::SenseAirComponent, esphome::serial_proxy::SerialProxy, esphome::servo::Servo, esphome::sfa30::SFA30Component, esphome::sgp30::SGP30Component, esphome::sgp4x::SGP4xComponent, esphome::shelly_dimmer::ShellyDimmer, esphome::sht3xd::SHT3XDComponent, esphome::sht4x::SHT4XComponent, esphome::shtcx::SHTCXComponent, esphome::shutdown::ShutdownButton, esphome::shutdown::ShutdownSwitch, esphome::sigma_delta_output::SigmaDeltaOutput, esphome::sim800l::Sim800LComponent, esphome::slow_pwm::SlowPWMOutput, esphome::sm10bit_base::Sm10BitBase, esphome::sm16716::SM16716, esphome::sm2135::SM2135, esphome::sm2235::SM2235, esphome::sm2335::SM2335, esphome::sm300d2::SM300D2Sensor, esphome::sml::Sml, esphome::sml::SmlSensor, esphome::sml::SmlTextSensor, esphome::smt100::SMT100Component, esphome::sn74hc165::SN74HC165Component, esphome::sn74hc595::SN74HC595Component, esphome::sntp::SNTPComponent, esphome::sonoff_d1::SonoffD1Output, esphome::sound_level::SoundLevelComponent, esphome::spa06_base::SPA06Component, esphome::spa06_i2c::SPA06I2CComponent, esphome::speaker_source::SpeakerSourceMediaPlayer, esphome::speed::SpeedFan, esphome::spi::SPIComponent, esphome::spi_device::SPIDeviceComponent, esphome::spi_led_strip::SpiLedStrip, esphome::sprinkler::Sprinkler, esphome::sprinkler::SprinklerControllerNumber, esphome::sprinkler::SprinklerControllerSwitch, esphome::sps30::SPS30Component, esphome::ssd1306_i2c::I2CSSD1306, esphome::ssd1306_spi::SPISSD1306, esphome::ssd1322_spi::SPISSD1322, esphome::ssd1325_spi::SPISSD1325, esphome::ssd1327_i2c::I2CSSD1327, esphome::ssd1327_spi::SPISSD1327, esphome::ssd1331_spi::SPISSD1331, esphome::ssd1351_spi::SPISSD1351, esphome::st7123::ST7123Touchscreen, esphome::st7567_i2c::I2CST7567, esphome::st7567_spi::SPIST7567, esphome::st7701s::ST7701S, esphome::st7735::ST7735, esphome::st7789v::ST7789V, esphome::st7920::ST7920, esphome::statsd::StatsdComponent, esphome::status::StatusBinarySensor, esphome::status_led::StatusLED, esphome::status_led::StatusLEDLightOutput, esphome::sts3x::STS3XComponent, esphome::stts22h::STTS22HComponent, esphome::sun::SunSensor, esphome::sun::SunTextSensor, esphome::sun_gtil2::SunGTIL2, esphome::switch_::SwitchBinarySensor, esphome::sx126x::SX126x, esphome::sx127x::SX127x, esphome::sx1509::SX1509Component, esphome::sx1509::SX1509FloatOutputChannel, esphome::sy6970::SY6970Component, esphome::t6615::T6615Component, esphome::tc74::TC74Component, esphome::tca9548a::TCA9548AComponent, esphome::tca9555::TCA9555Component, esphome::tcs34725::TCS34725Component, esphome::tee501::TEE501Component, esphome::teleinfo::TeleInfo, esphome::teleinfo::TeleInfoSensor, esphome::teleinfo::TeleInfoTextSensor, esphome::tem3200::TEM3200Component, esphome::template_::TemplateAlarmControlPanel, esphome::template_::TemplateBinarySensor, esphome::template_::TemplateCover, esphome::template_::TemplateDate, esphome::template_::TemplateDateTime, esphome::template_::TemplateFan, esphome::template_::TemplateLock, esphome::template_::TemplateNumber, esphome::template_::TemplateSelect< HAS_LAMBDA, OPTIMISTIC, RESTORE_VALUE, INITIAL_OPTION_INDEX >, esphome::template_::TemplateSensor, esphome::template_::TemplateSwitch, esphome::template_::TemplateText, esphome::template_::TemplateTextSensor, esphome::template_::TemplateTime, esphome::template_::TemplateValve, esphome::template_::TemplateWaterHeater, esphome::text::TextTextSensor, esphome::thermopro_ble::ThermoProBLE, esphome::thermostat::ThermostatClimate, esphome::time::RealTimeClock, esphome::time_based::TimeBasedCover, esphome::tinyusb::TinyUSB, esphome::tlc59208f::TLC59208FOutput, esphome::tlc5947::TLC5947, esphome::tlc5971::TLC5971, esphome::tm1621::TM1621Display, esphome::tm1637::TM1637Display, esphome::tm1638::TM1638Component, esphome::tm1638::TM1638OutputLed, esphome::tm1638::TM1638SwitchLed, esphome::tm1651::TM1651Display, esphome::tmp102::TMP102Component, esphome::tmp1075::TMP1075Sensor, esphome::tmp117::TMP117Component, esphome::tof10120::TOF10120Sensor, esphome::tormatic::Tormatic, esphome::total_daily_energy::TotalDailyEnergy, esphome::tsl2561::TSL2561Sensor, esphome::tsl2591::TSL2591Component, esphome::tt21100::TT21100Button, esphome::tt21100::TT21100Touchscreen, esphome::ttp229_bsf::TTP229BSFComponent, esphome::ttp229_lsf::TTP229LSFComponent, esphome::tuya::Tuya, esphome::tuya::TuyaBinarySensor, esphome::tuya::TuyaClimate, esphome::tuya::TuyaCover, esphome::tuya::TuyaFan, esphome::tuya::TuyaLight, esphome::tuya::TuyaNumber, esphome::tuya::TuyaSelect, esphome::tuya::TuyaSensor, esphome::tuya::TuyaSwitch, esphome::tuya::TuyaTextSensor, esphome::tx20::Tx20Component, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2UartComponent, esphome::uart::UARTButton, esphome::uart::UARTEvent, esphome::uart::UARTSwitch, esphome::udp::UDPComponent, esphome::ufire_ec::UFireECComponent, esphome::ufire_ise::UFireISEComponent, esphome::uln2003::ULN2003, esphome::ultrasonic::UltrasonicSensorComponent, esphome::uponor_smatrix::UponorSmatrixClimate, esphome::uponor_smatrix::UponorSmatrixComponent, esphome::uptime::UptimeSecondsSensor, esphome::uptime::UptimeTextSensor, esphome::uptime::UptimeTimestampSensor, esphome::usb_cdc_acm::USBCDCACMComponent, esphome::usb_host::USBClient, esphome::usb_uart::USBUartComponent, esphome::usb_uart::USBUartTypeCH34X, esphome::vbus::DeltaSolBS2009BSensor, esphome::vbus::DeltaSolBS2009Sensor, esphome::vbus::DeltaSolBS2BSensor, esphome::vbus::DeltaSolBS2Sensor, esphome::vbus::DeltaSolBSPlusBSensor, esphome::vbus::DeltaSolBSPlusSensor, esphome::vbus::DeltaSolCBSensor, esphome::vbus::DeltaSolCS2BSensor, esphome::vbus::DeltaSolCS2Sensor, esphome::vbus::DeltaSolCS4BSensor, esphome::vbus::DeltaSolCS4Sensor, esphome::vbus::DeltaSolCSensor, esphome::vbus::DeltaSolCSPlusBSensor, esphome::vbus::DeltaSolCSPlusSensor, esphome::vbus::VBus, esphome::vbus::VBusCustomBSensor, esphome::vbus::VBusCustomSensor, esphome::veml3235::VEML3235Sensor, esphome::veml7700::VEML7700Component, esphome::version::VersionTextSensor, esphome::vl53l0x::VL53L0XSensor, esphome::wake_on_lan::WakeOnLanButton, esphome::waveshare_epaper::GDEW0154M09, esphome::waveshare_epaper::GDEW029T5, esphome::waveshare_epaper::GDEY029T94, esphome::waveshare_epaper::GDEY042T81, esphome::waveshare_epaper::GDEY0583T81, esphome::waveshare_epaper::WaveshareEPaper13P3InK, esphome::waveshare_epaper::WaveshareEPaper1P54InBV2, esphome::waveshare_epaper::WaveshareEPaper2P13InDKE, esphome::waveshare_epaper::WaveshareEPaper2P13InV3, esphome::waveshare_epaper::WaveshareEPaper2P7In, esphome::waveshare_epaper::WaveshareEPaper2P7InB, esphome::waveshare_epaper::WaveshareEPaper2P7InBV2, esphome::waveshare_epaper::WaveshareEPaper2P7InV2, esphome::waveshare_epaper::WaveshareEPaper2P9InB, esphome::waveshare_epaper::WaveshareEPaper2P9InBV3, esphome::waveshare_epaper::WaveshareEPaper2P9InD, esphome::waveshare_epaper::WaveshareEPaper2P9InDKE, esphome::waveshare_epaper::WaveshareEPaper2P9InV2R2, esphome::waveshare_epaper::WaveshareEPaper4P2In, esphome::waveshare_epaper::WaveshareEPaper4P2InBV2, esphome::waveshare_epaper::WaveshareEPaper4P2InBV2BWR, esphome::waveshare_epaper::WaveshareEPaper5P65InF, esphome::waveshare_epaper::WaveshareEPaper5P8In, esphome::waveshare_epaper::WaveshareEPaper5P8InV2, esphome::waveshare_epaper::WaveshareEPaper7P3InF, esphome::waveshare_epaper::WaveshareEPaper7P5In, esphome::waveshare_epaper::WaveshareEPaper7P5InBC, esphome::waveshare_epaper::WaveshareEPaper7P5InBV2, esphome::waveshare_epaper::WaveshareEPaper7P5InBV3, esphome::waveshare_epaper::WaveshareEPaper7P5InBV3BWR, esphome::waveshare_epaper::WaveshareEPaper7P5InHDB, esphome::waveshare_epaper::WaveshareEPaper7P5InV2, esphome::waveshare_epaper::WaveshareEPaper7P5InV2alt, esphome::waveshare_epaper::WaveshareEPaper7P5InV2P, esphome::waveshare_epaper::WaveshareEPaperTypeA, esphome::waveshare_io_ch32v003::WaveshareIOCH32V003Component, esphome::waveshare_io_ch32v003::WaveshareIOCH32V003Sensor, esphome::web_server::WebServer, esphome::web_server::WebServerOTAComponent, esphome::weikai_i2c::WeikaiComponentI2C, esphome::weikai_spi::WeikaiComponentSPI, esphome::wiegand::Wiegand, esphome::wifi::WiFiComponent, esphome::wifi_info::BSSIDWiFiInfo, esphome::wifi_info::DNSAddressWifiInfo, esphome::wifi_info::IPAddressWiFiInfo, esphome::wifi_info::MacAddressWifiInfo, esphome::wifi_info::PowerSaveModeWiFiInfo, esphome::wifi_info::ScanResultsWiFiInfo, esphome::wifi_info::SSIDWiFiInfo, esphome::wireguard::Wireguard, esphome::wl_134::Wl134Component, esphome::wts01::WTS01Sensor, esphome::x9c::X9cOutput, esphome::xdb401::XDB401Component, esphome::xgzp68xx::XGZP68XXComponent, esphome::xiaomi_cgd1::XiaomiCGD1, esphome::xiaomi_cgdk2::XiaomiCGDK2, esphome::xiaomi_cgg1::XiaomiCGG1, esphome::xiaomi_cgpr1::XiaomiCGPR1, esphome::xiaomi_gcls002::XiaomiGCLS002, esphome::xiaomi_hhccjcy01::XiaomiHHCCJCY01, esphome::xiaomi_hhccjcy10::XiaomiHHCCJCY10, esphome::xiaomi_hhccpot002::XiaomiHHCCPOT002, esphome::xiaomi_jqjcy01ym::XiaomiJQJCY01YM, esphome::xiaomi_lywsd02::XiaomiLYWSD02, esphome::xiaomi_lywsd02mmc::XiaomiLYWSD02MMC, esphome::xiaomi_lywsd03mmc::XiaomiLYWSD03MMC, esphome::xiaomi_lywsdcgq::XiaomiLYWSDCGQ, esphome::xiaomi_mhoc303::XiaomiMHOC303, esphome::xiaomi_mhoc401::XiaomiMHOC401, esphome::xiaomi_miscale::XiaomiMiscale, esphome::xiaomi_mjyd02yla::XiaomiMJYD02YLA, esphome::xiaomi_mue4094rt::XiaomiMUE4094RT, esphome::xiaomi_rtcgq02lm::XiaomiRTCGQ02LM, esphome::xiaomi_wx08zm::XiaomiWX08ZM, esphome::xiaomi_xmwsdj04mmc::XiaomiXMWSDJ04MMC, esphome::xl9535::XL9535Component, esphome::xpt2046::XPT2046Component, esphome::zephyr_ble_server::BLEServer, esphome::zephyr_mcumgr::OTAComponent, esphome::zigbee::ZigbeeBinarySensor, esphome::zigbee::ZigbeeComponent, esphome::zigbee::ZigbeeComponent, esphome::zigbee::ZigbeeNumber, esphome::zigbee::ZigbeeSensor, esphome::zigbee::ZigbeeSwitch, esphome::zigbee::ZigbeeTime, esphome::zio_ultrasonic::ZioUltrasonicComponent, esphome::zwave_proxy::ZWaveProxy, and esphome::zyaura::ZyAuraSensor.
Definition at line 332 of file component.cpp.
|
inline |
Enable this component's loop.
The loop() method will be called normally.
This is useful for components that transition between active and inactive states and need to re-enable their loop() method when becoming active again.
Definition at line 246 of file component.h.
|
protected |
Definition at line 217 of file component.cpp.
| void IRAM_ATTR esphome::Component::enable_loop_soon_any_context | ( | ) |
Thread and ISR-safe version of enable_loop() that can be called from any context.
This method defers the actual enable via enable_pending_loops_ to the main loop, making it safe to call from ISR handlers, timer callbacks, other threads, or any interrupt context.
Use disable_loop() from the main thread only.
If you need to disable the loop from ISR, carefully implement it in the component itself, with an ISR safe approach, and call disable_loop() in its next loop() iteration. Implementations will need to carefully consider all possible race conditions.
Definition at line 222 of file component.cpp.
| float esphome::Component::get_actual_setup_priority | ( | ) | const |
Definition at line 345 of file component.cpp.
|
inline |
Get the integration where this component was declared as a LogString for logging.
Returns LOG_STR("<unknown>") if source not set
Definition at line 325 of file component.h.
|
inline |
Definition at line 193 of file component.h.
|
virtual |
priority of setup().
higher -> executed earlier
Defaults to setup_priority::DATA, i.e. 600.
Reimplemented in esphome::a4988::A4988, esphome::adc128s102::ADC128S102, esphome::apds9306::APDS9306, esphome::api::APIServer, esphome::atm90e32::ATM90E32Component, esphome::bedjet::BedJetClimate, esphome::bedjet::BedJetFan, esphome::bedjet::BedJetHub, esphome::beken_spi_led_strip::BekenSPILEDStripLightOutput, esphome::binary_sensor::MultiClickTriggerBase, esphome::bk72xx_ble::BK72xxBLE, esphome::bl0940::CalibrationNumber, esphome::bmi270::BMI270Component, esphome::bp1658cj::BP1658CJ, esphome::bp5758d::BP5758D, esphome::canbus::Canbus, esphome::captive_portal::CaptivePortal, esphome::cd74hc4067::CD74HC4067Sensor, esphome::ch422g::CH422GComponent, esphome::ch423::CH423Component, esphome::ct_clamp::CTClampSensor, esphome::dac7678::DAC7678Output, esphome::debug::DebugComponent, esphome::deep_sleep::DeepSleepComponent, esphome::deep_sleep::Ext1WakeTrigger, esphome::deep_sleep::WakeTrigger, esphome::dew_point::DewPointComponent, esphome::display_menu_base::DisplayMenuComponent, esphome::ds2484::DS2484OneWireBus, esphome::ds248x::DS248xComponent, esphome::ds248x::DS248xOneWireBus, esphome::e131::E131Component, esphome::emc2101::Emc2101Component, esphome::epaper_spi::EPaperBase, esphome::esp32_ble::ESP32BLE, esphome::esp32_ble_beacon::ESP32BLEBeacon, esphome::esp32_ble_client::BLEClientBase, esphome::esp32_ble_server::BLEServer, esphome::esp32_ble_tracker::ESP32BLETracker, esphome::esp32_camera_web_server::CameraWebServer, esphome::esp32_dac::ESP32DAC, esphome::esp32_hosted::Esp32HostedUpdate, esphome::esp32_improv::ESP32ImprovComponent, esphome::esp32_rmt_led_strip::ESP32RMTLEDStripLightOutput, esphome::esp8266_pwm::ESP8266PWM, esphome::esp_ldo::EspLdo, esphome::ESPHomeOTAComponent, esphome::espnow::ESPNowComponent, esphome::espnow::ESPNowTransport, esphome::ethernet::EthernetComponent, esphome::ethernet_info::MACAddressEthernetInfo, esphome::fastled_base::FastLEDLightOutput, esphome::ForCondition< Ts >, esphome::globals::RestoringGlobalsComponent< T >, esphome::globals::RestoringGlobalStringComponent< T, SZ >, esphome::gp2y1010au0f::GP2Y1010AU0FSensor, esphome::gp8403::GP8403Output, esphome::gpio::GPIOBinaryOutput, esphome::gpio::GPIOBinarySensor, esphome::gpio::GPIOOneWireBus, esphome::gpio::GPIOSwitch, esphome::gps::GPS, esphome::graph::Graph, esphome::haier::HaierClimateBase, esphome::hbridge::HBridgeLightOutput, esphome::hbridge::HBridgeSwitch, esphome::homeassistant::HomeassistantBinarySensor, esphome::homeassistant::HomeassistantNumber, esphome::homeassistant::HomeassistantSensor, esphome::homeassistant::HomeassistantSwitch, esphome::homeassistant::HomeassistantTextSensor, esphome::honeywellabp::HONEYWELLABPSensor, esphome::http_request::HttpRequestComponent, esphome::http_request::HttpRequestUpdate, esphome::http_request::OtaHttpRequestComponent, esphome::hub75::HUB75Display, esphome::i2c::ArduinoI2CBus, esphome::i2c::HostI2CBus, esphome::i2c::IDFI2CBus, esphome::i2c::ZephyrI2CBus, esphome::i2s_audio::I2SAudioSpeakerBase, esphome::ili9xxx::ILI9XXXDisplay, esphome::improv_serial::ImprovSerialComponent, esphome::infrared::Infrared, esphome::inkplate::Inkplate, esphome::it8951::IT8951Display, esphome::lcd_base::LCDDisplay, esphome::lcd_menu::LCDCharacterMenuComponent, esphome::ld2420::LD2420Component, esphome::ledc::LEDCOutput, esphome::libretiny::LTComponent, esphome::libretiny_pwm::LibreTinyPWM, esphome::light::LightState, esphome::logger::Logger, esphome::LoopTrigger, esphome::lsm6ds::LSM6DSComponent, esphome::lvgl::LvAnimation< DATA_SIZE, AUTO_START >, esphome::lvgl::LvglComponent, esphome::lvgl::LvLambdaComponent, esphome::max6956::MAX6956, esphome::max6956::MAX6956LedChannel, esphome::max7219::MAX7219Component, esphome::max7219digit::MAX7219Component, esphome::mcp23016::MCP23016, esphome::mcp23xxx_base::MCP23XXXBase< N >, esphome::mcp23xxx_base::MCP23XXXBase< 16 >, esphome::mcp23xxx_base::MCP23XXXBase< 8 >, esphome::mcp3008::MCP3008, esphome::mcp3204::MCP3204, esphome::mcp4461::Mcp4461Component, esphome::mcp4728::MCP4728Component, esphome::mdns::MDNSComponent, esphome::micro_wake_word::MicroWakeWord, esphome::midea::ApplianceBase< T >, esphome::midea::ApplianceBase< dudanov::midea::ac::AirConditioner >, esphome::modbus::Modbus, esphome::modbus_controller::ModbusNumber, esphome::motion::MotionComponent, esphome::mpr121::MPR121Component, esphome::mqtt::MQTTClientComponent, esphome::mqtt::MQTTComponent, esphome::mqtt::MQTTMessageTrigger, esphome::mqtt_subscribe::MQTTSubscribeSensor, esphome::mqtt_subscribe::MQTTSubscribeTextSensor, esphome::my9231::MY9231OutputComponent, esphome::neopixelbus::NeoPixelBusLightOutputBase< T_METHOD, T_COLOR_FEATURE >, esphome::neopixelbus::NeoPixelBusLightOutputBase< T_METHOD, NeoRgbFeature >, esphome::neopixelbus::NeoPixelBusLightOutputBase< T_METHOD, NeoRgbwFeature >, esphome::network::NetworkComponent, esphome::number::ValueRangeTrigger, esphome::opentherm::OpenthermHub, esphome::openthread::OpenThreadComponent, esphome::openthread::OpenThreadSrpComponent, esphome::openthread_info::IPAddressOpenThreadInfo, esphome::openthread_info::OpenThreadInstancePollingComponent, esphome::output::OutputLock, esphome::output::OutputSwitch, esphome::pca6416a::PCA6416AComponent, esphome::pca9554::PCA9554Component, esphome::pca9685::PCA9685Output, esphome::pcd8544::PCD8544, esphome::pcf8574::PCF8574Component, esphome::pcm5122::PCM5122, esphome::pi4ioe5v6408::PI4IOE5V6408Component, esphome::pixoo::Pixoo, esphome::power_supply::PowerSupply, esphome::preferences::IntervalSyncer, esphome::ProjectUpdateTrigger, esphome::prometheus::PrometheusHandler, esphome::provisioning::ProvisioningManager, esphome::qmi8658::QMI8658Component, esphome::radio_frequency::RadioFrequency, esphome::remote_transmitter::RemoteTransmitterComponent, esphome::resampler::ResamplerSpeaker, esphome::router::Router, esphome::rp2040_ble::RP2040BLE, esphome::rp2040_pio_led_strip::RP2040PIOLEDStripLightOutput, esphome::rp2040_pwm::RP2040PWM, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::safe_mode::SafeModeComponent, esphome::sdl::Sdl, esphome::seeed_mr24hpc1::MR24HPC1Component, esphome::seeed_mr60bha2::MR60BHA2Component, esphome::seeed_mr60fda2::MR60FDA2Component, esphome::sendspin_::SendspinChild, esphome::sendspin_::SendspinHub, esphome::sendspin_::SendspinPollingChild, esphome::sensor::TimeoutFilterBase, esphome::sensor::ValueRangeTrigger, esphome::serial_proxy::SerialProxy, esphome::shelly_dimmer::ShellyDimmer, esphome::ShutdownTrigger, esphome::slow_pwm::SlowPWMOutput, esphome::sm10bit_base::Sm10BitBase, esphome::sm16716::SM16716, esphome::sm2135::SM2135, esphome::sn74hc165::SN74HC165Component, esphome::sn74hc595::SN74HC595Component, esphome::sntp::SNTPComponent, esphome::sound_level::SoundLevelComponent, esphome::speaker::SpeakerMediaPlayer, esphome::speaker_source::SpeakerSourceMediaPlayer, esphome::spi::SPIComponent, esphome::spi_led_strip::SpiLedStrip, esphome::sprinkler::SprinklerControllerNumber, esphome::sprinkler::SprinklerControllerSwitch, esphome::ssd1306_base::SSD1306, esphome::ssd1322_base::SSD1322, esphome::ssd1325_base::SSD1325, esphome::ssd1327_base::SSD1327, esphome::ssd1331_base::SSD1331, esphome::ssd1351_base::SSD1351, esphome::st7567_base::ST7567, esphome::st7735::ST7735, esphome::st7789v::ST7789V, esphome::st7920::ST7920, esphome::StartupTrigger, esphome::statsd::StatsdComponent, esphome::status_led::StatusLED, esphome::status_led::StatusLEDLightOutput, esphome::sun_gtil2::SunGTIL2, esphome::sx126x::SX126x, esphome::sx126x::SX126xTransport, esphome::sx127x::SX127x, esphome::sx127x::SX127xTransport, esphome::sx1509::SX1509Component, esphome::sx1509::SX1509FloatOutputChannel, esphome::tca9548a::TCA9548AComponent, esphome::tca9555::TCA9555Component, esphome::template_::TemplateBinarySensor, esphome::template_::TemplateCover, esphome::template_::TemplateDate, esphome::template_::TemplateDateTime, esphome::template_::TemplateLock, esphome::template_::TemplateNumber, esphome::template_::TemplateSelect< HAS_LAMBDA, OPTIMISTIC, RESTORE_VALUE, INITIAL_OPTION_INDEX >, esphome::template_::TemplateSensor, esphome::template_::TemplateSwitch, esphome::template_::TemplateText, esphome::template_::TemplateTextSensor, esphome::template_::TemplateTime, esphome::template_::TemplateValve, esphome::template_::TemplateWaterHeater, esphome::time::CronTrigger, esphome::tinyusb::TinyUSB, esphome::tlc59208f::TLC59208FOutput, esphome::tlc5947::TLC5947, esphome::tlc5971::TLC5971, esphome::tm1621::TM1621Display, esphome::tm1637::TM1637Display, esphome::tm1638::TM1638Component, esphome::tt21100::TT21100Touchscreen, esphome::tuya::Tuya, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2UartComponent, esphome::uart::UARTTransport, esphome::udp::UDPComponent, esphome::udp::UDPTransport, esphome::uln2003::ULN2003, esphome::uptime::UptimeSecondsSensor, esphome::uptime::UptimeTextSensor, esphome::uptime::UptimeTimestampSensor, esphome::usb_cdc_acm::USBCDCACMComponent, esphome::usb_host::USBClient, esphome::usb_host::USBHost, esphome::voice_assistant::VoiceAssistant, esphome::WaitUntilAction< Ts >, esphome::wake_on_lan::WakeOnLanButton, esphome::waveshare_epaper::WaveshareEPaperBase, esphome::waveshare_io_ch32v003::WaveshareIOCH32V003Component, esphome::waveshare_io_ch32v003::WaveshareIOCH32V003Sensor, esphome::web_server::WebServer, esphome::web_server::WebServerOTAComponent, esphome::weikai::WeikaiComponent, esphome::wiegand::Wiegand, esphome::wifi::WiFiComponent, esphome::wifi_info::ScanResultsWiFiInfo, esphome::wireguard::Wireguard, esphome::xl9535::XL9535Component, and esphome::zwave_proxy::ZWaveProxy.
Definition at line 82 of file component.cpp.
|
inline |
Definition at line 319 of file component.h.
|
inline |
Definition at line 272 of file component.h.
|
inline |
Check if this component is idle.
Being idle means being in LOOP_DONE state. This means the component has completed setup, is not failed, but its loop is currently disabled.
Definition at line 213 of file component.h.
|
inline |
Check if this component has completed setup and is in the loop state.
Definition at line 205 of file component.h.
| bool esphome::Component::is_ready | ( | ) | const |
Definition at line 265 of file component.cpp.
|
virtual |
This method will be called repeatedly.
Analogous to Arduino's loop(). setup() is guaranteed to be called before this. Defaults to doing nothing.
Reimplemented in esphome::a01nyub::A01nyubComponent, esphome::a02yyuw::A02yyuwComponent, esphome::a4988::A4988, esphome::absolute_humidity::AbsoluteHumidityComponent, esphome::ade7880::ADE7880, esphome::am43::Am43Component, esphome::anova::Anova, esphome::api::APIServer, esphome::atm90e32::ATM90E32Component, esphome::audio_file::AudioFileMediaSource, esphome::audio_http::AudioHTTPMediaSource, esphome::bedjet::BedJetClimate, esphome::bedjet::BedJetHub, esphome::bh1750::BH1750Sensor, esphome::binary_sensor_map::BinarySensorMap, esphome::bk72xx_ble::BK72xxBLE, esphome::bl0939::BL0939, esphome::bl0940::BL0940, esphome::bl0942::BL0942, esphome::ble_client::BLEBinaryOutput, esphome::ble_client::BLEClient, esphome::ble_client::BLEClientRSSISensor, esphome::ble_client::BLEClientSwitch, esphome::ble_client::BLESensor, esphome::ble_client::BLETextSensor, esphome::ble_nus::BLENUS, esphome::ble_presence::BLEPresenceDevice, esphome::bluetooth_proxy::BluetoothConnection, esphome::bluetooth_proxy::BluetoothProxy, esphome::bme680_bsec::BME680BSECComponent, esphome::bme68x_bsec2::BME68xBSEC2Component, esphome::bp1658cj::BP1658CJ, esphome::bp5758d::BP5758D, esphome::canbus::Canbus, esphome::cap1188::CAP1188Component, esphome::captive_portal::CaptivePortal, esphome::cc1101::CC1101Component, esphome::ch422g::CH422GComponent, esphome::ch423::CH423Component, esphome::cse7766::CSE7766Component, esphome::ct_clamp::CTClampSensor, esphome::current_based::CurrentBasedCover, esphome::daly_bms::DalyBmsComponent, esphome::datetime::OnDateTimeTrigger, esphome::datetime::OnTimeTrigger, esphome::debug::DebugComponent, esphome::deep_sleep::DeepSleepComponent, esphome::dew_point::DewPointComponent, esphome::dfplayer::DFPlayer, esphome::dlms_meter::DlmsMeterComponent, esphome::dsmr::Dsmr, esphome::duty_time_sensor::DutyTimeSensor, esphome::e131::E131Component, esphome::emontx::EmonTx, esphome::endstop::EndstopCover, esphome::epaper_spi::EPaperBase, esphome::esp32_ble::ESP32BLE, esphome::esp32_ble_client::BLEClientBase, esphome::esp32_ble_server::BLEServer, esphome::esp32_ble_tracker::ESP32BLETracker, esphome::esp32_camera::ESP32Camera, esphome::esp32_camera_web_server::CameraWebServer, esphome::esp32_improv::ESP32ImprovComponent, esphome::esp32_touch::ESP32TouchComponent, esphome::ESPHomeOTAComponent, esphome::espnow::ESPNowComponent, esphome::ethernet::EthernetComponent, esphome::ezo::EZOSensor, esphome::ezo_pmp::EzoPMP, esphome::feedback::FeedbackCover, esphome::ForCondition< Ts >, esphome::gcja5::GCJA5Component, esphome::gp2y1010au0f::GP2Y1010AU0FSensor, esphome::gpio::GPIOBinarySensor, esphome::gps::GPS, esphome::growatt_solar::GrowattSolar, esphome::haier::HaierClimateBase, esphome::he60r::HE60rCover, esphome::hlw8032::HLW8032Component, esphome::honeywell_hih_i2c::HoneywellHIComponent, esphome::honeywellabp2_i2c::HONEYWELLABP2Sensor, esphome::hrxl_maxsonar_wr::HrxlMaxsonarWrComponent, esphome::hydreon_rgxx::HydreonRGxxComponent, esphome::i2s_audio::I2SAudioMicrophone, esphome::i2s_audio::I2SAudioSpeakerBase, esphome::improv_serial::ImprovSerialComponent, esphome::ina2xx_base::INA2XX, esphome::it8951::IT8951Display, esphome::jsn_sr04t::Jsnsr04tComponent, esphome::kamstrup_kmp::KamstrupKMPComponent, esphome::key_collector::KeyCollector, esphome::kuntze::Kuntze, esphome::ld2420::LD2420Component, esphome::light::LightState, esphome::logger::Logger, esphome::LoopTrigger, esphome::ltr501::LTRAlsPs501Component, esphome::ltr_als_ps::LTRAlsPsComponent, esphome::lvgl::LvAnimation< DATA_SIZE, AUTO_START >, esphome::lvgl::LvglComponent, esphome::matrix_keypad::MatrixKeypad, esphome::max7219digit::MAX7219Component, esphome::mcp23016::MCP23016, esphome::mcp23xxx_base::MCP23XXXBase< N >, esphome::mcp23xxx_base::MCP23XXXBase< 16 >, esphome::mcp23xxx_base::MCP23XXXBase< 8 >, esphome::mcp4461::Mcp4461Component, esphome::mcp4728::MCP4728Component, esphome::micro_wake_word::MicroWakeWord, esphome::micronova::MicroNova, esphome::midea::ApplianceBase< T >, esphome::midea::ApplianceBase< dudanov::midea::ac::AirConditioner >, esphome::mipi_rgb::MipiRgb, esphome::mitsubishi_cn105::MitsubishiCN105Climate, esphome::mixer_speaker::MixerSpeaker, esphome::mixer_speaker::SourceSpeaker, esphome::modbus::Modbus, esphome::modbus::ModbusClientHub, esphome::modbus_controller::ModbusController, esphome::mpr121::MPR121Component, esphome::mqtt::MQTTClientComponent, esphome::msa3xx::MSA3xxComponent, esphome::my9231::MY9231OutputComponent, esphome::nau7802::NAU7802Sensor, esphome::nextion::Nextion, esphome::online_image::OnlineImage, esphome::opentherm::OpenthermHub, esphome::packet_transport::PacketTransport, esphome::pca6416a::PCA6416AComponent, esphome::pca9554::PCA9554Component, esphome::pca9685::PCA9685Output, esphome::pcf8574::PCF8574Component, esphome::pi4ioe5v6408::PI4IOE5V6408Component, esphome::pm1006::PM1006Component, esphome::pmsx003::PMSX003Component, esphome::pn532::PN532, esphome::pn7150::PN7150, esphome::pn7160::PN7160, esphome::preferences::IntervalSyncer, esphome::provisioning::ProvisioningManager, esphome::pulse_meter::PulseMeterSensor, esphome::pylontech::PylontechComponent, esphome::pzem004t::PZEM004T, esphome::qmc5883l::QMC5883LComponent, esphome::qwiic_pir::QwiicPIRComponent, esphome::rc522::RC522, esphome::rd03d::RD03DComponent, esphome::rdm6300::RDM6300Component, esphome::remote_receiver::RemoteReceiverComponent, esphome::resampler::ResamplerSpeaker, esphome::rf_bridge::RFBridgeComponent, esphome::rotary_encoder::RotaryEncoderSensor, esphome::router::Router, esphome::rp2040_ble::RP2040BLE, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::rtttl::Rtttl, esphome::safe_mode::SafeModeComponent, esphome::script::QueueingScript< Ts >, esphome::script::ScriptWaitAction< C, Ts >, esphome::sdl::Sdl, esphome::sds011::SDS011Component, esphome::seeed_mr24hpc1::MR24HPC1Component, esphome::seeed_mr60bha2::MR60BHA2Component, esphome::seeed_mr60fda2::MR60FDA2Component, esphome::sendspin_::SendspinHub, esphome::sensor::TimeoutFilterBase, esphome::serial_proxy::SerialProxy, esphome::servo::Servo, esphome::sim800l::Sim800LComponent, esphome::slow_pwm::SlowPWMOutput, esphome::sm10bit_base::Sm10BitBase, esphome::sm16716::SM16716, esphome::sm2135::SM2135, esphome::sml::Sml, esphome::smt100::SMT100Component, esphome::sn74hc165::SN74HC165Component, esphome::sntp::SNTPComponent, esphome::sonoff_d1::SonoffD1Output, esphome::sound_level::SoundLevelComponent, esphome::speaker::SpeakerMediaPlayer, esphome::speaker_source::SpeakerSourceMediaPlayer, esphome::sprinkler::Sprinkler, esphome::sprinkler::SprinklerControllerSwitch, esphome::st7701s::ST7701S, esphome::status_led::StatusLED, esphome::status_led::StatusLEDLightOutput, esphome::sun_gtil2::SunGTIL2, esphome::sx126x::SX126x, esphome::sx127x::SX127x, esphome::sx1509::SX1509Component, esphome::t6615::T6615Component, esphome::tca9555::TCA9555Component, esphome::teleinfo::TeleInfo, esphome::template_::TemplateAlarmControlPanel, esphome::template_::TemplateBinarySensor, esphome::template_::TemplateCover, esphome::template_::TemplateLock, esphome::template_::TemplateSwitch, esphome::template_::TemplateValve, esphome::template_::TemplateWaterHeater, esphome::thermostat::ThermostatClimate, esphome::time_based::TimeBasedCover, esphome::tlc59208f::TLC59208FOutput, esphome::tlc5947::TLC5947, esphome::tlc5971::TLC5971, esphome::tm1637::TM1637Display, esphome::tm1638::TM1638Component, esphome::tormatic::Tormatic, esphome::touchscreen::Touchscreen, esphome::ttp229_bsf::TTP229BSFComponent, esphome::ttp229_lsf::TTP229LSFComponent, esphome::tuya::Tuya, esphome::tuya::TuyaClimate, esphome::tx20::Tx20Component, esphome::uart::UARTDebugger, esphome::uart::UARTDummyReceiver, esphome::uart::UARTEvent, esphome::uart::UARTSwitch, esphome::uart::UARTTransport, esphome::udp::UDPComponent, esphome::uln2003::ULN2003, esphome::ultrasonic::UltrasonicSensorComponent, esphome::uponor_smatrix::UponorSmatrixClimate, esphome::uponor_smatrix::UponorSmatrixComponent, esphome::usb_cdc_acm::USBCDCACMComponent, esphome::usb_host::USBClient, esphome::usb_host::USBHost, esphome::usb_uart::USBUartComponent, esphome::vbus::VBus, esphome::veml7700::VEML7700Component, esphome::vl53l0x::VL53L0XSensor, esphome::voice_assistant::VoiceAssistant, esphome::WaitUntilAction< Ts >, esphome::waveshare_io_ch32v003::WaveshareIOCH32V003Component, esphome::web_server::WebServer, esphome::weikai::WeikaiComponent, esphome::wiegand::Wiegand, esphome::wifi::WiFiComponent, esphome::wifi::WiFiConfigureAction< Ts >, esphome::wireguard::Wireguard, esphome::wl_134::Wl134Component, esphome::wts01::WTS01Sensor, esphome::zigbee::ZigbeeAttribute, esphome::zigbee::ZigbeeComponent, esphome::zigbee::ZigbeeComponent, and esphome::zwave_proxy::ZWaveProxy.
Definition at line 86 of file component.cpp.
| void esphome::Component::mark_failed | ( | ) |
Mark this component as failed.
Any future timeouts/intervals/setup/loop will no longer be called.
This might be useful if a component wants to indicate that a connection to its peripheral failed. For example, i2c based components can check if the remote device is responding and otherwise mark the component as failed. Eventually this will also enable smart status LEDs.
Definition at line 203 of file component.cpp.
|
inline |
Definition at line 223 of file component.h.
|
inlinevirtual |
Called after teardown is complete to power down hardware.
This is called after all components have finished their teardown process, making it safe to power down hardware like ethernet PHY.
Reimplemented in esphome::ethernet::EthernetComponent, esphome::ili9xxx::ILI9XXXDisplay, esphome::ina219::INA219Component, esphome::pn532::PN532, and esphome::power_supply::PowerSupply.
Definition at line 191 of file component.h.
|
inlinevirtual |
Reimplemented in esphome::epaper_spi::EPaperBase, esphome::esp32_dac::ESP32DAC, esphome::it8951::IT8951Display, esphome::safe_mode::SafeModeComponent, and esphome::waveshare_epaper::WaveshareEPaperBase.
Definition at line 178 of file component.h.
|
inlinevirtual |
Reimplemented in esphome::api::APIServer, esphome::debug::DebugComponent, esphome::ds248x::DS248xComponent, esphome::esp32_camera_web_server::CameraWebServer, esphome::esp32_touch::ESP32TouchComponent, esphome::globals::RestoringGlobalsComponent< T >, esphome::globals::RestoringGlobalStringComponent< T, SZ >, esphome::mdns::MDNSComponent, esphome::mqtt::MQTTClientComponent, esphome::opentherm::OpenthermHub, esphome::preferences::IntervalSyncer, esphome::ShutdownTrigger, and esphome::wireguard::Wireguard.
Definition at line 177 of file component.h.
| void esphome::Component::reset_to_construction_state | ( | ) |
Reset this component back to the construction state to allow setup to run again.
This can be used by components that have recoverable failures to attempt setup again.
Definition at line 238 of file component.cpp.
|
inlineprotected |
Set where this component was loaded from for some debug messages.
This is set by the ESPHome core during setup, and should not be called manually.
| index | 1-based index into the component source lookup table (0 = not set) |
Definition at line 341 of file component.h.
|
inlineprotected |
Helper to set component state (clears state bits and sets new state)
Definition at line 349 of file component.h.
|
protected |
Set an interval function with a const char* name.
Empty name means no cancelling possible.
This will call f every interval ms. Can be cancelled via cancel_interval(). Similar to javascript's setInterval().
IMPORTANT NOTE: The only guarantee offered by this call is that the callback will be called no earlier than the specified interval after the previous call. Any given interval may be longer due to other components blocking the loop() call.
So do not rely on this having correct timing. If you need exact timing please use hardware timers.
Note also that the first call to f will not happen immediately, but after a random delay. This is intended to prevent many interval functions from being called at the same time.
IMPORTANT: The provided name pointer must remain valid for the lifetime of the scheduler item. This means the name should be:
For dynamic names, use the uint32_t id overload instead.
| name | The identifier for this interval function (must have static lifetime) |
| interval | The interval in ms |
| f | The function to call |
Definition at line 88 of file component.cpp.
|
protected |
Definition at line 123 of file component.cpp.
|
protected |
Set an interval function with a numeric ID (zero heap allocation).
| id | The numeric identifier for this interval function |
| interval | The interval in ms |
| f | The function to call |
Definition at line 117 of file component.cpp.
|
protected |
Definition at line 262 of file component.cpp.
| void esphome::Component::set_setup_priority | ( | float | priority | ) |
Definition at line 360 of file component.cpp.
|
protected |
Helper to set a status LED flag on both this component and the app.
Returns true if the flag was newly set, false if it was already set. Note: Callers often use the return value to decide whether to log a warning/error, so once a flag is set, subsequent (potentially different) messages may be suppressed.
Definition at line 272 of file component.cpp.
|
protected |
Set a timeout function with a const char* name.
Similar to javascript's setTimeout(). Empty name means no cancelling possible.
IMPORTANT: Do not rely on this having correct timing. This is only called from loop() and therefore can be significantly delayed. If you need exact timing please use hardware timers.
IMPORTANT: The provided name pointer must remain valid for the lifetime of the scheduler item. This means the name should be:
For dynamic names, use the uint32_t id overload instead.
| name | The identifier for this timeout function (must have static lifetime) |
| timeout | The timeout in ms |
| f | The function to call |
Definition at line 96 of file component.cpp.
|
protected |
Definition at line 111 of file component.cpp.
|
protected |
Set a timeout function with a numeric ID (zero heap allocation).
| id | The numeric identifier for this timeout function |
| timeout | The timeout in ms |
| f | The function to call |
Definition at line 105 of file component.cpp.
|
protected |
Definition at line 259 of file component.cpp.
|
virtual |
Where the component's initialization should happen.
Analogous to Arduino's setup(). This method is guaranteed to only be called once. Defaults to doing nothing.
Reimplemented in esphome::a4988::A4988, esphome::absolute_humidity::AbsoluteHumidityComponent, esphome::ac_dimmer::AcDimmer, esphome::adc128s102::ADC128S102, esphome::adc::ADCSensor, esphome::addressable_light::AddressableLightDisplay, esphome::ade7880::ADE7880, esphome::ade7953_base::ADE7953, esphome::ade7953_spi::AdE7953Spi, esphome::ads1115::ADS1115Component, esphome::ads1118::ADS1118, esphome::ags10::AGS10Component, esphome::aht10::AHT10Component, esphome::aic3204::AIC3204, esphome::airthings_wave_plus::AirthingsWavePlus, esphome::alpha3::Alpha3, esphome::am2315c::AM2315C, esphome::am2320::AM2320Component, esphome::am43::Am43, esphome::am43::Am43Component, esphome::analog_threshold::AnalogThresholdBinarySensor, esphome::anova::Anova, esphome::apds9306::APDS9306, esphome::api::APIServer, esphome::aqi::AQISensor, esphome::as3935_spi::SPIAS3935Component, esphome::as5600::AS5600Component, esphome::as7341::AS7341Component, esphome::at581x::AT581XComponent, esphome::atm90e26::ATM90E26Component, esphome::atm90e32::ATM90E32Component, esphome::audio_file::AudioFileMediaSource, esphome::audio_http::AudioHTTPMediaSource, esphome::axs15231::AXS15231Touchscreen, esphome::bang_bang::BangBangClimate, esphome::bedjet::BedJetClimate, esphome::bedjet::BedJetHub, esphome::beken_spi_led_strip::BekenSPILEDStripLightOutput, esphome::bh1750::BH1750Sensor, esphome::bh1900nux::BH1900NUXSensor, esphome::binary::BinaryFan, esphome::binary_sensor::MultiClickTriggerBase, esphome::bk72xx_ble::BK72xxBLE, esphome::bl0939::BL0939, esphome::bl0940::BL0940, esphome::bl0940::CalibrationNumber, esphome::bl0942::BL0942, esphome::ble_client::BLEClient, esphome::ble_nus::BLENUS, esphome::bluetooth_proxy::BluetoothProxy, esphome::bm8563::BM8563, esphome::bme280_base::BME280Component, esphome::bme680::BME680Component, esphome::bme680_bsec::BME680BSECComponent, esphome::bme68x_bsec2::BME68xBSEC2Component, esphome::bmi160::BMI160Component, esphome::bmi270::BMI270Component, esphome::bmp085::BMP085Component, esphome::bmp280_base::BMP280Component, esphome::bmp3xx_base::BMP3XXComponent, esphome::bmp581_base::BMP581Component, esphome::bmp581_spi::BMP581SPIComponent, esphome::bp1658cj::BP1658CJ, esphome::bp5758d::BP5758D, esphome::canbus::Canbus, esphome::canbus::CanbusTrigger, esphome::cap1188::CAP1188Component, esphome::captive_portal::CaptivePortal, esphome::cc1101::CC1101Component, esphome::ccs811::CCS811Component, esphome::cd74hc4067::CD74HC4067Component, esphome::ch422g::CH422GComponent, esphome::ch423::CH423Component, esphome::chsc6x::CHSC6XTouchscreen, esphome::climate_ir::ClimateIR, esphome::cm1106::CM1106Component, esphome::combination::CombinationNoParameterComponent, esphome::combination::KalmanCombinationComponent, esphome::combination::LinearCombinationComponent, esphome::copy::CopyBinarySensor, esphome::copy::CopyCover, esphome::copy::CopyFan, esphome::copy::CopyLock, esphome::copy::CopyNumber, esphome::copy::CopySelect, esphome::copy::CopySensor, esphome::copy::CopySwitch, esphome::copy::CopyText, esphome::copy::CopyTextSensor, esphome::cs5460a::CS5460AComponent, esphome::cse7761::CSE7761Component, esphome::cst226::CST226Button, esphome::cst226::CST226Touchscreen, esphome::cst328::CST328Button, esphome::cst328::CST328Touchscreen, esphome::cst816::CST816Touchscreen, esphome::cst9220::CST9220Touchscreen, esphome::current_based::CurrentBasedCover, esphome::dac7678::DAC7678Output, esphome::daikin_arc::DaikinArcClimate, esphome::dallas_temp::DallasTemperatureSensor, esphome::deep_sleep::DeepSleepComponent, esphome::deep_sleep::Ext1WakeTrigger, esphome::deep_sleep::WakeTrigger, esphome::demo::DemoAlarmControlPanel, esphome::demo::DemoBinarySensor, esphome::demo::DemoClimate, esphome::demo::DemoCover, esphome::demo::DemoDate, esphome::demo::DemoDateTime, esphome::demo::DemoNumber, esphome::demo::DemoSwitch, esphome::demo::DemoText, esphome::demo::DemoTime, esphome::dew_point::DewPointComponent, esphome::dht12::DHT12Component, esphome::dht::DHT, esphome::dlms_meter::DlmsMeterComponent, esphome::dps310::DPS310Component, esphome::ds1307::DS1307Component, esphome::ds2484::DS2484OneWireBus, esphome::ds248x::DS248xComponent, esphome::ds248x::DS248xOneWireBus, esphome::dsmr::Dsmr, esphome::duty_cycle::DutyCycleSensor, esphome::duty_time_sensor::DutyTimeSensor, esphome::e131::E131Component, esphome::ee895::EE895Component, esphome::ektf2232::EKTF2232Touchscreen, esphome::emc2101::Emc2101Component, esphome::emontx::EmonTx, esphome::endstop::EndstopCover, esphome::ens160_base::ENS160Component, esphome::ens210::ENS210Component, esphome::epaper_spi::EPaperBase, esphome::epaper_spi::EPaperT133A01, esphome::es7210::ES7210, esphome::es7243e::ES7243E, esphome::es8156::ES8156, esphome::es8311::ES8311, esphome::esp32_ble::ESP32BLE, esphome::esp32_ble_beacon::ESP32BLEBeacon, esphome::esp32_ble_client::BLEClientBase, esphome::esp32_ble_server::BLEServer, esphome::esp32_ble_tracker::ESP32BLETracker, esphome::esp32_camera::ESP32Camera, esphome::esp32_camera_web_server::CameraWebServer, esphome::esp32_dac::ESP32DAC, esphome::esp32_hosted::Esp32HostedUpdate, esphome::esp32_improv::ESP32ImprovComponent, esphome::esp32_rmt_led_strip::ESP32RMTLEDStripLightOutput, esphome::esp32_touch::ESP32TouchComponent, esphome::esp8266_pwm::ESP8266PWM, esphome::esp_ldo::EspLdo, esphome::ESPHomeOTAComponent, esphome::espnow::ESPNowComponent, esphome::espnow::ESPNowTransport, esphome::ethernet::EthernetComponent, esphome::ethernet_info::DNSAddressEthernetInfo, esphome::ethernet_info::IPAddressEthernetInfo, esphome::ethernet_info::MACAddressEthernetInfo, esphome::factory_reset::FactoryResetComponent, esphome::fastled_base::FastLEDLightOutput, esphome::feedback::FeedbackCover, esphome::fingerprint_grow::FingerprintGrowComponent, esphome::fs3000::FS3000Component, esphome::ft5x06::FT5x06Touchscreen, esphome::ft63x6::FT63X6Touchscreen, esphome::gl_r01_i2c::GLR01I2CComponent, esphome::globals::GlobalsComponent< T >, esphome::globals::RestoringGlobalsComponent< T >, esphome::globals::RestoringGlobalStringComponent< T, SZ >, esphome::gp8403::GP8403Component, esphome::gpio::GPIOBinaryOutput, esphome::gpio::GPIOBinarySensor, esphome::gpio::GPIOOneWireBus, esphome::gpio::GPIOSwitch, esphome::graph::Graph, esphome::graphical_display_menu::GraphicalDisplayMenu, esphome::gree::GreeModeBitSwitch, esphome::grove_tb6612fng::GroveMotorDriveTB6612FNG, esphome::gsl3670::GSL3670Touchscreen, esphome::gt911::GT911Button, esphome::gt911::GT911Touchscreen, esphome::haier::HaierClimateBase, esphome::hbridge::HBridgeFan, esphome::hbridge::HBridgeLightOutput, esphome::hbridge::HBridgeSwitch, esphome::hc8::HC8Component, esphome::hdc1080::HDC1080Component, esphome::hdc2010::HDC2010Component, esphome::hdc2080::HDC2080Component, esphome::hdc302x::HDC302XComponent, esphome::he60r::HE60rCover, esphome::heatpumpir::HeatpumpIRClimate, esphome::hlk_fm22x::HlkFm22xComponent, esphome::hlw8012::HLW8012Component, esphome::hm3301::HM3301Component, esphome::hmc5883l::HMC5883LComponent, esphome::homeassistant::HomeassistantBinarySensor, esphome::homeassistant::HomeassistantNumber, esphome::homeassistant::HomeassistantSensor, esphome::homeassistant::HomeassistantSwitch, esphome::homeassistant::HomeassistantTextSensor, esphome::homeassistant::HomeassistantTime, esphome::honeywellabp::HONEYWELLABPSensor, esphome::hte501::HTE501Component, esphome::http_request::HttpRequestUpdate, esphome::htu21d::HTU21DComponent, esphome::htu31d::HTU31DComponent, esphome::hub75::HUB75Display, esphome::hx711::HX711Sensor, esphome::hydreon_rgxx::HydreonRGxxComponent, esphome::i2c::ArduinoI2CBus, esphome::i2c::HostI2CBus, esphome::i2c::IDFI2CBus, esphome::i2c::ZephyrI2CBus, esphome::i2s_audio::I2SAudioMicrophone, esphome::i2s_audio::I2SAudioSpeakerBase, esphome::i2s_audio::I2SAudioSpeakerSPDIF, esphome::iaqcore::IAQCore, esphome::ili9xxx::ILI9XXXDisplay, esphome::improv_serial::ImprovSerialComponent, esphome::ina219::INA219Component, esphome::ina226::INA226Component, esphome::ina260::INA260Component, esphome::ina2xx_base::INA2XX, esphome::ina2xx_i2c::INA2XXI2C, esphome::ina2xx_spi::INA2XXSPI, esphome::ina3221::INA3221Component, esphome::infrared::Infrared, esphome::inkplate::Inkplate, esphome::integration::IntegrationSensor, esphome::internal_temperature::InternalTemperatureSensor, esphome::interval::IntervalTrigger, esphome::ir_rf_proxy::RfProxy, esphome::it8951::IT8951Display, esphome::kmeteriso::KMeterISOComponent, esphome::lc709203f::Lc709203f, esphome::lcd_base::LCDDisplay, esphome::lcd_gpio::GPIOLCDDisplay, esphome::lcd_menu::LCDCharacterMenuComponent, esphome::lcd_pcf8574::PCF8574LCDDisplay, esphome::ld2420::LD2420Component, esphome::ledc::LEDCOutput, esphome::libretiny_pwm::LibreTinyPWM, esphome::light::LightState, esphome::lightwaverf::LightWaveRF, esphome::lilygo_t5_47::LilygoT547Touchscreen, esphome::logger::LoggerLevelSelect, esphome::lps22::LPS22Component, esphome::lsm6ds::LSM6DSComponent, esphome::ltr390::LTR390Component, esphome::ltr501::LTRAlsPs501Component, esphome::ltr_als_ps::LTRAlsPsComponent, esphome::lvgl::LvAnimation< DATA_SIZE, AUTO_START >, esphome::lvgl::LvglComponent, esphome::lvgl::LVGLNumber, esphome::lvgl::LVGLSelect, esphome::lvgl::LVGLSwitch, esphome::lvgl::LvLambdaComponent, esphome::m5stack_8angle::M5Stack8AngleComponent, esphome::m5stack_8angle::M5Stack8AngleLightOutput, esphome::matrix_keypad::MatrixKeypad, esphome::max17043::MAX17043Component, esphome::max31855::MAX31855Sensor, esphome::max31856::MAX31856Sensor, esphome::max31865::MAX31865Sensor, esphome::max44009::MAX44009Sensor, esphome::max6675::MAX6675Sensor, esphome::max6956::MAX6956, esphome::max6956::MAX6956LedChannel, esphome::max7219::MAX7219Component, esphome::max7219digit::MAX7219Component, esphome::max9611::MAX9611Component, esphome::mcp23008::MCP23008, esphome::mcp23016::MCP23016, esphome::mcp23017::MCP23017, esphome::mcp23s08::MCP23S08, esphome::mcp23s17::MCP23S17, esphome::mcp3008::MCP3008, esphome::mcp3204::MCP3204, esphome::mcp4461::Mcp4461Component, esphome::mcp4725::MCP4725, esphome::mcp4728::MCP4728Component, esphome::mcp9600::MCP9600Component, esphome::mcp9808::MCP9808Sensor, esphome::mdns::MDNSComponent, esphome::mhz19::MHZ19Component, esphome::micro_wake_word::MicroWakeWord, esphome::micronova::MicroNova, esphome::midea::ApplianceBase< T >, esphome::midea::ApplianceBase< dudanov::midea::ac::AirConditioner >, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_rgb::MipiRgbSpi, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::mipi_spi::MipiSpiBuffer< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION, FRACTION, ROUNDING >, esphome::mitsubishi_cn105::MitsubishiCN105Climate, esphome::mixer_speaker::MixerSpeaker, esphome::mixer_speaker::SourceSpeaker, esphome::mlx90393::MLX90393Cls, esphome::mlx90614::MLX90614Component, esphome::mmc5603::MMC5603Component, esphome::mmc5983::MMC5983Component, esphome::modbus::Modbus, esphome::modbus_controller::ModbusController, esphome::modbus_controller::ModbusSwitch, esphome::motion::MotionComponent, esphome::mpl3115a2::MPL3115A2Component, esphome::mpr121::MPR121Component, esphome::mpu6050::MPU6050Component, esphome::mpu6886::MPU6886Component, esphome::mqtt::MQTTAlarmControlPanelComponent, esphome::mqtt::MQTTBinarySensorComponent, esphome::mqtt::MQTTButtonComponent, esphome::mqtt::MQTTClientComponent, esphome::mqtt::MQTTClimateComponent, esphome::mqtt::MQTTCoverComponent, esphome::mqtt::MQTTDateComponent, esphome::mqtt::MQTTDateTimeComponent, esphome::mqtt::MQTTEventComponent, esphome::mqtt::MQTTFanComponent, esphome::mqtt::MQTTJSONLightComponent, esphome::mqtt::MQTTLockComponent, esphome::mqtt::MQTTMessageTrigger, esphome::mqtt::MQTTNumberComponent, esphome::mqtt::MQTTSelectComponent, esphome::mqtt::MQTTSensorComponent, esphome::mqtt::MQTTSwitchComponent, esphome::mqtt::MQTTTextComponent, esphome::mqtt::MQTTTextSensor, esphome::mqtt::MQTTTimeComponent, esphome::mqtt::MQTTUpdateComponent, esphome::mqtt::MQTTValveComponent, esphome::mqtt_subscribe::MQTTSubscribeSensor, esphome::mqtt_subscribe::MQTTSubscribeTextSensor, esphome::ms5611::MS5611Component, esphome::ms8607::MS8607Component, esphome::msa3xx::MSA3xxComponent, esphome::my9231::MY9231OutputComponent, esphome::nau7802::NAU7802Sensor, esphome::neopixelbus::NeoPixelBusLightOutputBase< T_METHOD, T_COLOR_FEATURE >, esphome::neopixelbus::NeoPixelBusLightOutputBase< T_METHOD, NeoRgbFeature >, esphome::neopixelbus::NeoPixelBusLightOutputBase< T_METHOD, NeoRgbwFeature >, esphome::network::NetworkComponent, esphome::nextion::Nextion, esphome::nfc::NfcTagBinarySensor, esphome::noblex::NoblexClimate, esphome::npi19::NPI19Component, esphome::nrf52::DeviceFirmwareUpdate, esphome::ntc::NTC, esphome::number::NumberSensor, esphome::number::ValueRangeTrigger, esphome::opentherm::OpenthermHub, esphome::opentherm::OpenthermNumber, esphome::opentherm::OpenthermSwitch, esphome::openthread::OpenThreadComponent, esphome::openthread::OpenThreadSrpComponent, esphome::output::OutputSwitch, esphome::packet_transport::PacketTransport, esphome::pca6416a::PCA6416AComponent, esphome::pca9554::PCA9554Component, esphome::pca9685::PCA9685Output, esphome::pcd8544::PCD8544, esphome::pcf85063::PCF85063Component, esphome::pcf8563::PCF8563Component, esphome::pcf8574::PCF8574Component, esphome::pcm5122::PCM5122, esphome::pi4ioe5v6408::PI4IOE5V6408Component, esphome::pid::PIDClimate, esphome::pid::PIDClimateSensor, esphome::pixoo::Pixoo, esphome::pm1006::PM1006Component, esphome::pm2005::PM2005Component, esphome::pmsa003i::PMSA003IComponent, esphome::pmsx003::PMSX003Component, esphome::pn532::PN532, esphome::pn532_spi::PN532Spi, esphome::pn7150::PN7150, esphome::pn7160::PN7160, esphome::pn7160_spi::PN7160Spi, esphome::power_supply::PowerSupply, esphome::preferences::IntervalSyncer, esphome::ProjectUpdateTrigger, esphome::prometheus::PrometheusHandler, esphome::pulse_counter::PulseCounterSensor, esphome::pulse_meter::PulseMeterSensor, esphome::pulse_width::PulseWidthSensor, esphome::pylontech::PylontechComponent, esphome::pzem004t::PZEM004T, esphome::qmc5883l::QMC5883LComponent, esphome::qmi8658::QMI8658Component, esphome::qmp6988::QMP6988Component, esphome::qspi_dbi::QspiDbi, esphome::qwiic_pir::QwiicPIRComponent, esphome::rc522::RC522, esphome::rc522_spi::RC522Spi, esphome::rd03d::RD03DComponent, esphome::remote_receiver::RemoteReceiverComponent, esphome::remote_transmitter::RemoteTransmitterComponent, esphome::resampler::ResamplerSpeaker, esphome::resistance::ResistanceSensor, esphome::rotary_encoder::RotaryEncoderSensor, esphome::router::Router, esphome::rp2040_ble::RP2040BLE, esphome::rp2040_pio_led_strip::RP2040PIOLEDStripLightOutput, esphome::rp2040_pwm::RP2040PWM, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::rx8130::RX8130Component, esphome::scd30::SCD30Component, esphome::scd4x::SCD4XComponent, esphome::script::ScriptWaitAction< C, Ts >, esphome::sdl::Sdl, esphome::sdl::SdlTouchscreen, esphome::sdp3x::SDP3XComponent, esphome::sds011::SDS011Component, esphome::seeed_mr24hpc1::MR24HPC1Component, esphome::seeed_mr60fda2::MR60FDA2Component, esphome::sen0321_sensor::Sen0321Sensor, esphome::sen5x::SEN5XComponent, esphome::sendspin_::SendspinHub, esphome::sendspin_::SendspinMediaPlayer, esphome::sendspin_::SendspinMediaSource, esphome::sendspin_::SendspinMetadataSensor, esphome::sendspin_::SendspinTextSensor, esphome::sendspin_::SendspinTrackProgressSensor, esphome::sensor::ValueRangeTrigger, esphome::serial_proxy::SerialProxy, esphome::servo::Servo, esphome::sfa30::SFA30Component, esphome::sgp30::SGP30Component, esphome::sgp4x::SGP4xComponent, esphome::shelly_dimmer::ShellyDimmer, esphome::sht3xd::SHT3XDComponent, esphome::sht4x::SHT4XComponent, esphome::shtcx::SHTCXComponent, esphome::sigma_delta_output::SigmaDeltaOutput, esphome::slow_pwm::SlowPWMOutput, esphome::sm10bit_base::Sm10BitBase, esphome::sm16716::SM16716, esphome::sm2135::SM2135, esphome::sm2235::SM2235, esphome::sm2335::SM2335, esphome::sn74hc165::SN74HC165Component, esphome::sn74hc595::SN74HC595Component, esphome::sn74hc595::SN74HC595GPIOComponent, esphome::sn74hc595::SN74HC595SPIComponent, esphome::sntp::SNTPComponent, esphome::sonoff_d1::SonoffD1Output, esphome::sound_level::SoundLevelComponent, esphome::spa06_base::SPA06Component, esphome::speaker::SpeakerMediaPlayer, esphome::speaker_source::SpeakerSourceMediaPlayer, esphome::speed::SpeedFan, esphome::spi::SPIComponent, esphome::spi_device::SPIDeviceComponent, esphome::spi_led_strip::SpiLedStrip, esphome::sprinkler::Sprinkler, esphome::sprinkler::SprinklerControllerNumber, esphome::sprinkler::SprinklerControllerSwitch, esphome::sps30::SPS30Component, esphome::ssd1306_base::SSD1306, esphome::ssd1306_i2c::I2CSSD1306, esphome::ssd1306_spi::SPISSD1306, esphome::ssd1322_base::SSD1322, esphome::ssd1322_spi::SPISSD1322, esphome::ssd1325_base::SSD1325, esphome::ssd1325_spi::SPISSD1325, esphome::ssd1327_base::SSD1327, esphome::ssd1327_i2c::I2CSSD1327, esphome::ssd1327_spi::SPISSD1327, esphome::ssd1331_base::SSD1331, esphome::ssd1331_spi::SPISSD1331, esphome::ssd1351_base::SSD1351, esphome::ssd1351_spi::SPISSD1351, esphome::st7123::ST7123Touchscreen, esphome::st7567_base::ST7567, esphome::st7567_i2c::I2CST7567, esphome::st7567_spi::SPIST7567, esphome::st7701s::ST7701S, esphome::st7735::ST7735, esphome::st7789v::ST7789V, esphome::st7920::ST7920, esphome::StartupTrigger, esphome::statsd::StatsdComponent, esphome::status::StatusBinarySensor, esphome::status_led::StatusLEDLightOutput, esphome::sts3x::STS3XComponent, esphome::stts22h::STTS22HComponent, esphome::sun_gtil2::SunGTIL2, esphome::switch_::SwitchBinarySensor, esphome::sx126x::SX126x, esphome::sx126x::SX126xTransport, esphome::sx127x::SX127x, esphome::sx127x::SX127xTransport, esphome::sx1509::SX1509Component, esphome::sx1509::SX1509FloatOutputChannel, esphome::sy6970::SY6970Component, esphome::syslog::Syslog, esphome::tc74::TC74Component, esphome::tca9548a::TCA9548AComponent, esphome::tca9555::TCA9555Component, esphome::tcs34725::TCS34725Component, esphome::tee501::TEE501Component, esphome::teleinfo::TeleInfo, esphome::tem3200::TEM3200Component, esphome::template_::TemplateAlarmControlPanel, esphome::template_::TemplateBinarySensor, esphome::template_::TemplateCover, esphome::template_::TemplateDate, esphome::template_::TemplateDateTime, esphome::template_::TemplateFan, esphome::template_::TemplateLock, esphome::template_::TemplateNumber, esphome::template_::TemplateSelect< HAS_LAMBDA, OPTIMISTIC, RESTORE_VALUE, INITIAL_OPTION_INDEX >, esphome::template_::TemplateSwitch, esphome::template_::TemplateText, esphome::template_::TemplateTime, esphome::template_::TemplateValve, esphome::template_::TemplateWaterHeater, esphome::text::TextTextSensor, esphome::thermostat::ThermostatClimate, esphome::time::CronTrigger, esphome::time_based::TimeBasedCover, esphome::tinyusb::TinyUSB, esphome::tlc59208f::TLC59208FOutput, esphome::tlc5947::TLC5947, esphome::tlc5971::TLC5971, esphome::tm1621::TM1621Display, esphome::tm1637::TM1637Display, esphome::tm1638::TM1638Component, esphome::tm1651::TM1651Display, esphome::tmp1075::TMP1075Sensor, esphome::tmp117::TMP117Component, esphome::tof10120::TOF10120Sensor, esphome::tormatic::Tormatic, esphome::toshiba::ToshibaClimate, esphome::total_daily_energy::TotalDailyEnergy, esphome::touchscreen::TouchscreenBinarySensor, esphome::tsl2561::TSL2561Sensor, esphome::tsl2591::TSL2591Component, esphome::tt21100::TT21100Button, esphome::tt21100::TT21100Touchscreen, esphome::ttp229_bsf::TTP229BSFComponent, esphome::ttp229_lsf::TTP229LSFComponent, esphome::tuya::Tuya, esphome::tuya::TuyaBinarySensor, esphome::tuya::TuyaClimate, esphome::tuya::TuyaCover, esphome::tuya::TuyaFan, esphome::tuya::TuyaLight, esphome::tuya::TuyaNumber, esphome::tuya::TuyaSelect, esphome::tuya::TuyaSensor, esphome::tuya::TuyaSwitch, esphome::tuya::TuyaTextSensor, esphome::tx20::Tx20Component, esphome::uart::ESP8266UartComponent, esphome::uart::HostUartComponent, esphome::uart::IDFUARTComponent, esphome::uart::LibreTinyUARTComponent, esphome::uart::RP2UartComponent, esphome::uart::UARTEvent, esphome::udp::UDPComponent, esphome::udp::UDPTransport, esphome::ufire_ec::UFireECComponent, esphome::ufire_ise::UFireISEComponent, esphome::uln2003::ULN2003, esphome::ultrasonic::UltrasonicSensorComponent, esphome::uponor_smatrix::UponorSmatrixComponent, esphome::uptime::UptimeTextSensor, esphome::uptime::UptimeTimestampSensor, esphome::usb_cdc_acm::USBCDCACMComponent, esphome::usb_host::USBClient, esphome::usb_host::USBHost, esphome::usb_uart::USBUartComponent, esphome::veml3235::VEML3235Sensor, esphome::veml7700::VEML7700Component, esphome::version::VersionTextSensor, esphome::vl53l0x::VL53L0XSensor, esphome::voice_assistant::VoiceAssistant, esphome::wake_on_lan::WakeOnLanButton, esphome::waveshare_epaper::WaveshareEPaper2P13InV3, esphome::waveshare_epaper::WaveshareEPaper7C, esphome::waveshare_epaper::WaveshareEPaperBase, esphome::waveshare_io_ch32v003::WaveshareIOCH32V003Component, esphome::web_server::WebServer, esphome::web_server::WebServerOTAComponent, esphome::weikai_i2c::WeikaiComponentI2C, esphome::weikai_spi::WeikaiComponentSPI, esphome::whirlpool::WhirlpoolClimate, esphome::wiegand::Wiegand, esphome::wifi::WiFiComponent, esphome::wifi_info::BSSIDWiFiInfo, esphome::wifi_info::DNSAddressWifiInfo, esphome::wifi_info::IPAddressWiFiInfo, esphome::wifi_info::MacAddressWifiInfo, esphome::wifi_info::PowerSaveModeWiFiInfo, esphome::wifi_info::ScanResultsWiFiInfo, esphome::wifi_info::SSIDWiFiInfo, esphome::wireguard::Wireguard, esphome::wl_134::Wl134Component, esphome::x9c::X9cOutput, esphome::xdb401::XDB401Component, esphome::xgzp68xx::XGZP68XXComponent, esphome::xl9535::XL9535Component, esphome::xpt2046::XPT2046Component, esphome::yashima::YashimaClimate, esphome::zephyr::CdcAcm, esphome::zephyr_ble_server::BLEServer, esphome::zephyr_mcumgr::OTAComponent, esphome::zhlt01::ZHLT01Climate, esphome::zigbee::ZigbeeBinarySensor, esphome::zigbee::ZigbeeComponent, esphome::zigbee::ZigbeeComponent, esphome::zigbee::ZigbeeNumber, esphome::zigbee::ZigbeeSensor, esphome::zigbee::ZigbeeSwitch, esphome::zigbee::ZigbeeTime, esphome::zwave_proxy::ZWaveProxy, and esphome::zyaura::ZyAuraSensor.
Definition at line 84 of file component.cpp.
| bool esphome::Component::should_warn_of_blocking | ( | uint32_t | blocking_time, |
| uint32_t & | threshold_ms_out ) |
Definition at line 188 of file component.cpp.
|
inline |
Definition at line 295 of file component.h.
|
protected |
Definition at line 315 of file component.cpp.
|
inline |
Definition at line 289 of file component.h.
|
protected |
Definition at line 303 of file component.cpp.
|
inline |
Definition at line 280 of file component.h.
|
inline |
Definition at line 278 of file component.h.
| void esphome::Component::status_momentary_error | ( | const char * | name, |
| uint32_t | length = 5000 ) |
Set error status flag and automatically clear it after a timeout.
| name | Identifier for the timeout (used to cancel/replace existing timeouts with the same name). Must be a static string literal (stored in flash/rodata), not a temporary or dynamic string. This is NOT a message to display - use status_set_error() with a message if logging is needed. |
| length | Duration in milliseconds before the error is automatically cleared. |
Definition at line 328 of file component.cpp.
| void esphome::Component::status_momentary_warning | ( | const char * | name, |
| uint32_t | length = 5000 ) |
Set warning status flag and automatically clear it after a timeout.
| name | Identifier for the timeout (used to cancel/replace existing timeouts with the same name). Must be a static string literal (stored in flash/rodata), not a temporary or dynamic string. This is NOT a message to display - use status_set_warning() with a message if logging is needed. |
| length | Duration in milliseconds before the warning is automatically cleared. |
Definition at line 324 of file component.cpp.
| void esphome::Component::status_set_error | ( | ) |
Definition at line 293 of file component.cpp.
| void esphome::Component::status_set_error | ( | const LogString * | message | ) |
Definition at line 294 of file component.cpp.
| void esphome::Component::status_set_warning | ( | ) |
Definition at line 280 of file component.cpp.
| void esphome::Component::status_set_warning | ( | const char * | message | ) |
Definition at line 281 of file component.cpp.
| void esphome::Component::status_set_warning | ( | const LogString * | message | ) |
Definition at line 287 of file component.cpp.
|
inlinevirtual |
Called during teardown to allow component to gracefully finish operations.
Reimplemented in esphome::api::APIServer, and esphome::openthread::OpenThreadComponent.
Definition at line 184 of file component.h.
|
protected |
|
protected |
|
protected |
Index into component source PROGMEM lookup table (0 = not set)
Definition at line 487 of file component.h.
|
protected |
State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion.
Definition at line 495 of file component.h.
|
protected |
ISR-safe flag for enable_loop_soon_any_context.
Definition at line 496 of file component.h.
|
protected |
Definition at line 500 of file component.h.
|
protected |
Warn threshold in centiseconds (max 2550ms)
Definition at line 488 of file component.h.