ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
component.h File Reference

Go to the source code of this file.

Data Structures

class  esphome::Component
 
class  esphome::PollingComponent
 This class simplifies creating components that periodically check a state. More...
 
class  esphome::WarnIfComponentBlockingGuard
 

Namespaces

namespace  esphome
 Providing packet encoding functions for exchanging data with a remote host.
 
namespace  esphome::setup_priority
 Default setup priorities for components of different types.
 

Enumerations

enum class  esphome::InternalSchedulerID : uint32_t { esphome::POLLING_UPDATE = 0 , esphome::DELAY_ACTION = 1 }
 Type-safe scheduler IDs for core base classes. More...
 
enum class  esphome::RetryResult { esphome::DONE , esphome::RETRY }
 

Functions

void esphome::log_update_interval (const char *tag, PollingComponent *component)
 
void esphome::clear_setup_priority_overrides ()
 

Variables

constexpr float esphome::setup_priority::BUS = 1000.0f
 For communication buses like i2c/spi.
 
constexpr float esphome::setup_priority::IO = 900.0f
 For components that represent GPIO pins like PCF8573.
 
constexpr float esphome::setup_priority::HARDWARE = 800.0f
 For components that deal with hardware and are very important like GPIO switch.
 
constexpr float esphome::setup_priority::DATA = 600.0f
 For components that import data from directly connected sensors like DHT.
 
constexpr float esphome::setup_priority::PROCESSOR = 400.0f
 For components that use data from sensors like displays.
 
constexpr float esphome::setup_priority::BLUETOOTH = 350.0f
 
constexpr float esphome::setup_priority::AFTER_BLUETOOTH = 300.0f
 
constexpr float esphome::setup_priority::WIFI = 250.0f
 
constexpr float esphome::setup_priority::ETHERNET = 250.0f
 
constexpr float esphome::setup_priority::BEFORE_CONNECTION = 220.0f
 For components that should be initialized after WiFi and before API is connected.
 
constexpr float esphome::setup_priority::AFTER_WIFI = 200.0f
 For components that should be initialized after WiFi is connected.
 
constexpr float esphome::setup_priority::AFTER_CONNECTION = 100.0f
 For components that should be initialized after a data connection (API/MQTT) is connected.
 
constexpr float esphome::setup_priority::LATE = -100.0f
 For components that should be initialized at the very end of the setup process.
 
constexpr uint32_t esphome::SCHEDULER_DONT_RUN = 4294967295UL
 
constexpr uint8_t esphome::COMPONENT_STATE_MASK = 0x07
 
constexpr uint8_t esphome::COMPONENT_STATE_CONSTRUCTION = 0x00
 
constexpr uint8_t esphome::COMPONENT_STATE_SETUP = 0x01
 
constexpr uint8_t esphome::COMPONENT_STATE_LOOP = 0x02
 
constexpr uint8_t esphome::COMPONENT_STATE_FAILED = 0x03
 
constexpr uint8_t esphome::COMPONENT_STATE_LOOP_DONE = 0x04
 
constexpr uint8_t esphome::STATUS_LED_MASK = 0x18
 
constexpr uint8_t esphome::STATUS_LED_OK = 0x00
 
constexpr uint8_t esphome::STATUS_LED_WARNING = 0x08
 
constexpr uint8_t esphome::STATUS_LED_ERROR = 0x10
 
constexpr uint8_t esphome::COMPONENT_HAS_LOOP = 0x20
 
constexpr uint16_t esphome::WARN_IF_BLOCKING_OVER_MS = 50U