ESPHome  1.14.4
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
esphome Namespace Reference

Namespaces

 a4988
 
 adc
 
 ade7953
 
 ads1115
 
 am2320
 
 apds9960
 
 api
 
 as3935
 
 as3935_i2c
 
 as3935_spi
 
 atm90e32
 
 bang_bang
 
 bh1750
 
 binary
 
 binary_sensor
 
 binary_sensor_map
 
 ble_presence
 
 ble_rssi
 
 bme280
 
 bme680
 
 bmp085
 
 bmp280
 
 captive_portal
 
 ccs811
 
 climate
 
 climate_ir
 
 coolix
 
 cover
 
 cse7766
 
 ct_clamp
 
 custom
 
 custom_component
 
 cwww
 
 dallas
 
 debug
 
 deep_sleep
 
 dfplayer
 
 dht
 
 dht12
 
 display
 
 duty_cycle
 
 endstop
 
 esp32_ble_beacon
 
 esp32_ble_tracker
 
 esp32_camera
 
 esp32_hall
 
 esp32_touch
 
 esp8266_pwm
 
 ethernet
 
 fan
 
 fastled_base
 
 fujitsu_general
 
 globals
 
 gpio
 
 gps
 
 hdc1080
 
 hlw8012
 
 hmc5883l
 
 homeassistant
 
 htu21d
 
 hx711
 
 i2c
 
 ina219
 
 ina3221
 
 integration
 
 interval
 
 json
 
 lcd_base
 
 lcd_gpio
 
 lcd_pcf8574
 
 ledc
 
 light
 
 logger
 
 max31855
 
 max6675
 
 max7219
 
 mcp23008
 
 mcp23017
 
 mhz19
 
 modbus
 
 monochromatic
 
 mpr121
 
 mpu6050
 
 mqtt
 
 
 ms5611
 
 my9231
 
 neopixelbus
 
 nextion
 
 ntc
 
 ota
 
 output
 
 partition
 
 pca9685
 
 pcf8574
 
 pmsx003
 
 pn532
 
 power_supply
 
 pulse_counter
 
 pulse_width
 
 pzem004t
 
 pzemac
 
 pzemdc
 
 rdm6300
 
 remote_base
 
 remote_receiver
 
 remote_transmitter
 
 resistance
 
 restart
 
 rgb
 
 rgbw
 
 rgbww
 
 rotary_encoder
 
 scd30
 
 script
 
 sds011
 
 senseair
 
 sensor
 
 servo
 
 setup_priority
 Default setup priorities for components of different types.
 
 sgp30
 
 sht3xd
 
 shtcx
 
 shutdown
 
 sim800l
 
 sm16716
 
 sntp
 
 speed
 
 spi
 
 ssd1306_base
 
 ssd1306_i2c
 
 ssd1306_spi
 
 ssd1325_base
 
 ssd1325_spi
 
 status
 
 status_led
 
 stepper
 
 sts3x
 
 sun
 
 switch_
 
 sx1509
 
 tcl112
 
 tcs34725
 
 template_
 
 text_sensor
 
 time
 
 time_based
 
 tlc59208f
 
 total_daily_energy
 
 tsl2561
 
 ttp229_bsf
 
 ttp229_lsf
 
 tuya
 
 tx20
 
 uart
 
 uln2003
 
 ultrasonic
 
 uptime
 
 version
 
 vl53l0x
 
 voltage_sampler
 
 waveshare_epaper
 
 web_server
 
 web_server_base
 
 wifi
 
 wifi_info
 
 wifi_signal
 
 xiaomi_ble
 
 xiaomi_cgg1
 
 xiaomi_hhccjcy01
 
 xiaomi_lywsd02
 
 xiaomi_lywsdcgq
 
 yashima
 
 zyaura
 

Data Structures

class  Action
 
class  ActionList
 
class  AndCondition
 
class  Application
 
class  Automation
 
class  CallbackManager
 
class  CallbackManager< void(Ts...)>
 Simple helper class to allow having multiple subscribers to a signal. More...
 
class  Component
 
class  Condition
 Base class for all automation conditions. More...
 
class  Controller
 
class  Deduplicator
 
class  DelayAction
 
class  ESPPreferenceObject
 
class  ESPPreferences
 
class  ForCondition
 
struct  gens
 
struct  gens< 0, S... >
 
class  GPIOPin
 A high-level abstraction class that can expose a pin together with useful options like pinMode. More...
 
class  HighFrequencyLoopRequester
 
class  IfAction
 
class  InterruptLock
 
struct  is_callable
 
class  ISRInternalGPIOPin
 Copy of GPIOPin that is safe to use from ISRs (with no virtual functions) More...
 
class  LambdaAction
 
class  LambdaCondition
 
class  LoopTrigger
 
class  Nameable
 Helper class that enables naming of objects so that it doesn't have to be re-implement every time. More...
 
class  NotCondition
 
struct  nullopt_t
 
class  optional
 
class  OrCondition
 
class  Parented
 
class  PollingComponent
 This class simplifies creating components that periodically check a state. More...
 
class  Scheduler
 
struct  seq
 
class  ShutdownTrigger
 
class  StartupTrigger
 
class  TemplatableStringValue
 
class  TemplatableValue
 
class  Trigger
 
class  UpdateComponentAction
 
class  WaitUntilAction
 
class  WhileAction
 

Typedefs

template<bool B, class T = void>
using enable_if_t = typename std::enable_if< B, T >::type
 

Enumerations

enum  ParseOnOffState { PARSE_NONE = 0, PARSE_ON, PARSE_OFF, PARSE_TOGGLE }
 

Functions

void ICACHE_RAM_ATTR interrupt_handler (void *arg)
 
std::string get_mac_address ()
 Gets the MAC address as a string, this can be used as way to identify this ESP. More...
 
std::string get_mac_address_pretty ()
 
std::string generate_hostname (const std::string &base)
 
uint32_t random_uint32 ()
 Return a random 32 bit unsigned integer. More...
 
double random_double ()
 Returns a random double between 0 and 1. More...
 
float random_float ()
 Returns a random float between 0 and 1. Essentially just casts random_double() to a float. More...
 
void fast_random_set_seed (uint32_t seed)
 
uint32_t fast_random_32 ()
 
uint16_t fast_random_16 ()
 
uint8_t fast_random_8 ()
 
float gamma_correct (float value, float gamma)
 Applies gamma correction with the provided gamma to value. More...
 
std::string to_lowercase_underscore (std::string s)
 Convert the string to lowercase_underscore. More...
 
std::string sanitize_string_whitelist (const std::string &s, const std::string &whitelist)
 Sanitizes the input string with the whitelist. More...
 
std::string sanitize_hostname (const std::string &hostname)
 Sanitize the hostname by removing characters that are not in the whitelist and truncating it to 63 chars. More...
 
std::string truncate_string (const std::string &s, size_t length)
 Truncate a string to a specific length. More...
 
std::string value_accuracy_to_string (float value, int8_t accuracy_decimals)
 Create a string from a value and an accuracy in decimals. More...
 
std::string uint64_to_string (uint64_t num)
 Convert a uint64_t to a hex string. More...
 
std::string uint32_to_string (uint32_t num)
 Convert a uint32_t to a hex string. More...
 
void reserve_global_json_build_buffer (size_t required_size)
 
ParseOnOffState parse_on_off (const char *str, const char *on, const char *off)
 
uint8_t crc8 (uint8_t *data, uint8_t len)
 Calculate a crc8 of data with the provided data length. More...
 
void delay_microseconds_accurate (uint32_t usec)
 
uint8_t reverse_bits_8 (uint8_t x)
 
uint16_t reverse_bits_16 (uint16_t x)
 
std::string to_string (const std::string &val)
 
std::string to_string (int val)
 
std::string to_string (long val)
 
std::string to_string (long long val)
 
std::string to_string (unsigned val)
 
std::string to_string (unsigned long val)
 
std::string to_string (unsigned long long val)
 
std::string to_string (float val)
 
std::string to_string (double val)
 
std::string to_string (long double val)
 
optional< float > parse_float (const std::string &str)
 
uint32_t fnv1_hash (const std::string &str)
 
bool str_equals_case_insensitive (const std::string &a, const std::string &b)
 Compare string a to string b (ignoring case) and return whether they are equal. More...
 
template<uint32_t >
uint32_t reverse_bits (uint32_t x)
 
float clamp (float val, float min, float max)
 Clamp the value between min and max. More...
 
float lerp (float completion, float start, float end)
 Linearly interpolate between end start and end by completion. More...
 
bool str_startswith (const std::string &full, const std::string &start)
 
bool str_endswith (const std::string &full, const std::string &ending)
 
uint16_t encode_uint16 (uint8_t msb, uint8_t lsb)
 Encode a 16-bit unsigned integer given a most and least-significant byte. More...
 
std::array< uint8_t, 2 > decode_uint16 (uint16_t value)
 Decode a 16-bit unsigned integer into an array of two values: most significant byte, least significant byte. More...
 
std::string hexencode (const uint8_t *data, uint32_t len)
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... args)
 std::make_unique More...
 
uint32_t reverse_bits_32 (uint32_t x)
 
template<typename T >
std::string hexencode (const T &data)
 
template<typename T , enable_if_t<!std::is_pointer< T >::value, int > = 0>
id (T value)
 
template<typename T , enable_if_t< std::is_pointer< T *>::value, int > = 0>
T & id (T *value)
 
void HOT esp_log_printf_ (int level, const char *tag, int line, const char *format,...)
 
void HOT esp_log_printf_ (int level, const char *tag, int line, const __FlashStringHelper *format,...)
 
void HOT esp_log_vprintf_ (int level, const char *tag, int line, const char *format, va_list args)
 
void HOT esp_log_vprintf_ (int level, const char *tag, int line, const __FlashStringHelper *format, va_list args)
 
int HOT esp_idf_log_vprintf_ (const char *format, va_list args)
 
const nullopt_t nullopt ((nullopt_t::init()))
 
template<typename T , typename U >
bool operator== (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator!= (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator< (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator> (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator<= (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator>= (optional< T > const &x, optional< U > const &y)
 
template<typename T >
bool operator== (optional< T > const &x, nullopt_t)
 
template<typename T >
bool operator== (nullopt_t, optional< T > const &x)
 
template<typename T >
bool operator!= (optional< T > const &x, nullopt_t)
 
template<typename T >
bool operator!= (nullopt_t, optional< T > const &x)
 
template<typename T >
bool operator< (optional< T > const &, nullopt_t)
 
template<typename T >
bool operator< (nullopt_t, optional< T > const &x)
 
template<typename T >
bool operator<= (optional< T > const &x, nullopt_t)
 
template<typename T >
bool operator<= (nullopt_t, optional< T > const &)
 
template<typename T >
bool operator> (optional< T > const &x, nullopt_t)
 
template<typename T >
bool operator> (nullopt_t, optional< T > const &)
 
template<typename T >
bool operator>= (optional< T > const &, nullopt_t)
 
template<typename T >
bool operator>= (nullopt_t, optional< T > const &x)
 
template<typename T , typename U >
bool operator== (optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator== (U const &v, optional< T > const &x)
 
template<typename T , typename U >
bool operator!= (optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator!= (U const &v, optional< T > const &x)
 
template<typename T , typename U >
bool operator< (optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator< (U const &v, optional< T > const &x)
 
template<typename T , typename U >
bool operator<= (optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator<= (U const &v, optional< T > const &x)
 
template<typename T , typename U >
bool operator> (optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator> (U const &v, optional< T > const &x)
 
template<typename T , typename U >
bool operator>= (optional< T > const &x, U const &v)
 
template<typename T , typename U >
bool operator>= (U const &v, optional< T > const &x)
 
template<typename T >
void swap (optional< T > &x, optional< T > &y)
 
template<typename T >
optional< T > make_optional (T const &v)
 
bool network_is_connected ()
 Return whether the node is connected to the network (through wifi, eth, ...) More...
 
std::string network_get_address ()
 Get the active network hostname. More...
 
void network_setup_mdns (IPAddress address, int interface)
 Manually set up the network stack (outside of the App.setup() loop, for example in OTA safe mode) More...
 
void network_setup_mdns ()
 
void network_tick_mdns ()
 

Variables

Application App
 Global storage of Application pointer - only one Application can exist. More...
 
const uint32_t COMPONENT_STATE_MASK = 0xFF
 
const uint32_t COMPONENT_STATE_CONSTRUCTION = 0x00
 
const uint32_t COMPONENT_STATE_SETUP = 0x01
 
const uint32_t COMPONENT_STATE_LOOP = 0x02
 
const uint32_t COMPONENT_STATE_FAILED = 0x03
 
const uint32_t STATUS_LED_MASK = 0xFF00
 
const uint32_t STATUS_LED_OK = 0x0000
 
const uint32_t STATUS_LED_WARNING = 0x0100
 
const uint32_t STATUS_LED_ERROR = 0x0200
 
uint32_t global_state = 0
 
const char * HOSTNAME_CHARACTER_WHITELIST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
 The characters that are allowed in a hostname. More...
 
uint32_t _SPIFFS_end
 
ESPPreferences global_preferences
 

Typedef Documentation

◆ enable_if_t

template<bool B, class T = void>
using esphome::enable_if_t = typedef typename std::enable_if<B, T>::type

Definition at line 190 of file helpers.h.

Enumeration Type Documentation

◆ ParseOnOffState

Enumerator
PARSE_NONE 
PARSE_ON 
PARSE_OFF 
PARSE_TOGGLE 

Definition at line 172 of file helpers.h.

Function Documentation

◆ clamp()

float esphome::clamp ( float  val,
float  min,
float  max 
)

Clamp the value between min and max.

Parameters
valThe value.
minThe minimum value.
maxThe maximum value.
Returns
val clamped in between min and max.

Definition at line 281 of file helpers.cpp.

◆ crc8()

uint8_t esphome::crc8 ( uint8_t *  data,
uint8_t  len 
)

Calculate a crc8 of data with the provided data length.

Definition at line 159 of file helpers.cpp.

◆ decode_uint16()

std::array< uint8_t, 2 > esphome::decode_uint16 ( uint16_t  value)

Decode a 16-bit unsigned integer into an array of two values: most significant byte, least significant byte.

Definition at line 296 of file helpers.cpp.

◆ delay_microseconds_accurate()

void esphome::delay_microseconds_accurate ( uint32_t  usec)

Definition at line 174 of file helpers.cpp.

◆ encode_uint16()

uint16_t esphome::encode_uint16 ( uint8_t  msb,
uint8_t  lsb 
)

Encode a 16-bit unsigned integer given a most and least-significant byte.

Definition at line 295 of file helpers.cpp.

◆ esp_idf_log_vprintf_()

int esphome::esp_idf_log_vprintf_ ( const char *  format,
va_list  args 
)

Definition at line 50 of file log.cpp.

◆ esp_log_printf_() [1/2]

void esphome::esp_log_printf_ ( int  level,
const char *  tag,
int  line,
const char *  format,
  ... 
)

Definition at line 11 of file log.cpp.

◆ esp_log_printf_() [2/2]

void void esphome::esp_log_printf_ ( int  level,
const char *  tag,
int  line,
const __FlashStringHelper *  format,
  ... 
)

Definition at line 18 of file log.cpp.

◆ esp_log_vprintf_() [1/2]

void esphome::esp_log_vprintf_ ( int  level,
const char *  tag,
int  line,
const char *  format,
va_list  args 
)

Definition at line 26 of file log.cpp.

◆ esp_log_vprintf_() [2/2]

void esphome::esp_log_vprintf_ ( int  level,
const char *  tag,
int  line,
const __FlashStringHelper *  format,
va_list  args 
)

Definition at line 37 of file log.cpp.

◆ fast_random_16()

uint16_t esphome::fast_random_16 ( )

Definition at line 65 of file helpers.cpp.

◆ fast_random_32()

uint32_t esphome::fast_random_32 ( )

Definition at line 61 of file helpers.cpp.

◆ fast_random_8()

uint8_t esphome::fast_random_8 ( )

Definition at line 69 of file helpers.cpp.

◆ fast_random_set_seed()

void esphome::fast_random_set_seed ( uint32_t  seed)

Definition at line 60 of file helpers.cpp.

◆ fnv1_hash()

uint32_t esphome::fnv1_hash ( const std::string &  str)

Definition at line 249 of file helpers.cpp.

◆ gamma_correct()

float esphome::gamma_correct ( float  value,
float  gamma 
)

Applies gamma correction with the provided gamma to value.

Definition at line 74 of file helpers.cpp.

◆ generate_hostname()

std::string esphome::generate_hostname ( const std::string &  base)

Definition at line 44 of file helpers.cpp.

◆ get_mac_address()

std::string esphome::get_mac_address ( )

Gets the MAC address as a string, this can be used as way to identify this ESP.

Definition at line 18 of file helpers.cpp.

◆ get_mac_address_pretty()

std::string esphome::get_mac_address_pretty ( )

Definition at line 31 of file helpers.cpp.

◆ hexencode() [1/2]

template<typename T >
std::string esphome::hexencode ( const T &  data)

Definition at line 183 of file helpers.h.

◆ hexencode() [2/2]

std::string esphome::hexencode ( const uint8_t *  data,
uint32_t  len 
)

Definition at line 302 of file helpers.cpp.

◆ id() [1/2]

template<typename T , enable_if_t<!std::is_pointer< T >::value, int > = 0>
T esphome::id ( value)

Definition at line 192 of file helpers.h.

◆ id() [2/2]

template<typename T , enable_if_t< std::is_pointer< T *>::value, int > = 0>
T& esphome::id ( T *  value)

Definition at line 193 of file helpers.h.

◆ interrupt_handler()

void ICACHE_RAM_ATTR esphome::interrupt_handler ( void *  arg)

Definition at line 222 of file esphal.cpp.

◆ lerp()

float esphome::lerp ( float  completion,
float  start,
float  end 
)

Linearly interpolate between end start and end by completion.

Template Parameters
TThe input/output typename.
Parameters
startThe start value.
endThe end value.
completionThe completion. 0 is start value, 1 is end value.
Returns
The linearly interpolated value.

Definition at line 288 of file helpers.cpp.

◆ make_optional()

template<typename T >
optional<T> esphome::make_optional ( T const &  v)
inline

Definition at line 212 of file optional.h.

◆ make_unique()

template<typename T , typename... Args>
std::unique_ptr<T> esphome::make_unique ( Args &&...  args)

std::make_unique

Definition at line 91 of file helpers.h.

◆ network_get_address()

std::string esphome::network_get_address ( )

Get the active network hostname.

◆ network_is_connected()

bool esphome::network_is_connected ( )

Return whether the node is connected to the network (through wifi, eth, ...)

◆ network_setup_mdns() [1/2]

void esphome::network_setup_mdns ( IPAddress  address,
int  interface 
)

Manually set up the network stack (outside of the App.setup() loop, for example in OTA safe mode)

◆ network_setup_mdns() [2/2]

void esphome::network_setup_mdns ( )

◆ network_tick_mdns()

void esphome::network_tick_mdns ( )

◆ nullopt()

const nullopt_t esphome::nullopt ( (nullopt_t::init())  )

◆ operator!=() [1/5]

template<typename T , typename U >
bool esphome::operator!= ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Definition at line 116 of file optional.h.

◆ operator!=() [2/5]

template<typename T >
bool esphome::operator!= ( optional< T > const &  x,
nullopt_t   
)
inline

Definition at line 136 of file optional.h.

◆ operator!=() [3/5]

template<typename T >
bool esphome::operator!= ( nullopt_t  ,
optional< T > const &  x 
)
inline

Definition at line 138 of file optional.h.

◆ operator!=() [4/5]

template<typename T , typename U >
bool esphome::operator!= ( optional< T > const &  x,
U const &  v 
)
inline

Definition at line 166 of file optional.h.

◆ operator!=() [5/5]

template<typename T , typename U >
bool esphome::operator!= ( U const &  v,
optional< T > const &  x 
)
inline

Definition at line 170 of file optional.h.

◆ operator<() [1/5]

template<typename T , typename U >
bool esphome::operator< ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Definition at line 120 of file optional.h.

◆ operator<() [2/5]

template<typename T >
bool esphome::operator< ( optional< T > const &  ,
nullopt_t   
)
inline

Definition at line 140 of file optional.h.

◆ operator<() [3/5]

template<typename T >
bool esphome::operator< ( nullopt_t  ,
optional< T > const &  x 
)
inline

Definition at line 142 of file optional.h.

◆ operator<() [4/5]

template<typename T , typename U >
bool esphome::operator< ( optional< T > const &  x,
U const &  v 
)
inline

Definition at line 174 of file optional.h.

◆ operator<() [5/5]

template<typename T , typename U >
bool esphome::operator< ( U const &  v,
optional< T > const &  x 
)
inline

Definition at line 178 of file optional.h.

◆ operator<=() [1/5]

template<typename T , typename U >
bool esphome::operator<= ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Definition at line 126 of file optional.h.

◆ operator<=() [2/5]

template<typename T >
bool esphome::operator<= ( optional< T > const &  x,
nullopt_t   
)
inline

Definition at line 144 of file optional.h.

◆ operator<=() [3/5]

template<typename T >
bool esphome::operator<= ( nullopt_t  ,
optional< T > const &   
)
inline

Definition at line 146 of file optional.h.

◆ operator<=() [4/5]

template<typename T , typename U >
bool esphome::operator<= ( optional< T > const &  x,
U const &  v 
)
inline

Definition at line 182 of file optional.h.

◆ operator<=() [5/5]

template<typename T , typename U >
bool esphome::operator<= ( U const &  v,
optional< T > const &  x 
)
inline

Definition at line 186 of file optional.h.

◆ operator==() [1/5]

template<typename T , typename U >
bool esphome::operator== ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Definition at line 112 of file optional.h.

◆ operator==() [2/5]

template<typename T >
bool esphome::operator== ( optional< T > const &  x,
nullopt_t   
)
inline

Definition at line 132 of file optional.h.

◆ operator==() [3/5]

template<typename T >
bool esphome::operator== ( nullopt_t  ,
optional< T > const &  x 
)
inline

Definition at line 134 of file optional.h.

◆ operator==() [4/5]

template<typename T , typename U >
bool esphome::operator== ( optional< T > const &  x,
U const &  v 
)
inline

Definition at line 158 of file optional.h.

◆ operator==() [5/5]

template<typename T , typename U >
bool esphome::operator== ( U const &  v,
optional< T > const &  x 
)
inline

Definition at line 162 of file optional.h.

◆ operator>() [1/5]

template<typename T , typename U >
bool esphome::operator> ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Definition at line 124 of file optional.h.

◆ operator>() [2/5]

template<typename T >
bool esphome::operator> ( optional< T > const &  x,
nullopt_t   
)
inline

Definition at line 148 of file optional.h.

◆ operator>() [3/5]

template<typename T >
bool esphome::operator> ( nullopt_t  ,
optional< T > const &   
)
inline

Definition at line 150 of file optional.h.

◆ operator>() [4/5]

template<typename T , typename U >
bool esphome::operator> ( optional< T > const &  x,
U const &  v 
)
inline

Definition at line 190 of file optional.h.

◆ operator>() [5/5]

template<typename T , typename U >
bool esphome::operator> ( U const &  v,
optional< T > const &  x 
)
inline

Definition at line 194 of file optional.h.

◆ operator>=() [1/5]

template<typename T , typename U >
bool esphome::operator>= ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Definition at line 128 of file optional.h.

◆ operator>=() [2/5]

template<typename T >
bool esphome::operator>= ( optional< T > const &  ,
nullopt_t   
)
inline

Definition at line 152 of file optional.h.

◆ operator>=() [3/5]

template<typename T >
bool esphome::operator>= ( nullopt_t  ,
optional< T > const &  x 
)
inline

Definition at line 154 of file optional.h.

◆ operator>=() [4/5]

template<typename T , typename U >
bool esphome::operator>= ( optional< T > const &  x,
U const &  v 
)
inline

Definition at line 198 of file optional.h.

◆ operator>=() [5/5]

template<typename T , typename U >
bool esphome::operator>= ( U const &  v,
optional< T > const &  x 
)
inline

Definition at line 202 of file optional.h.

◆ parse_float()

optional< float > esphome::parse_float ( const std::string &  str)

Definition at line 242 of file helpers.cpp.

◆ parse_on_off()

ParseOnOffState esphome::parse_on_off ( const char *  str,
const char *  on,
const char *  off 
)

Definition at line 142 of file helpers.cpp.

◆ random_double()

double esphome::random_double ( )

Returns a random double between 0 and 1.

Note: This function probably doesn't provide a truly uniform distribution.

Definition at line 54 of file helpers.cpp.

◆ random_float()

float esphome::random_float ( )

Returns a random float between 0 and 1. Essentially just casts random_double() to a float.

Definition at line 56 of file helpers.cpp.

◆ random_uint32()

uint32_t esphome::random_uint32 ( )

Return a random 32 bit unsigned integer.

Definition at line 46 of file helpers.cpp.

◆ reserve_global_json_build_buffer()

void esphome::reserve_global_json_build_buffer ( size_t  required_size)

Definition at line 129 of file helpers.cpp.

◆ reverse_bits()

template<uint32_t >
uint32_t esphome::reverse_bits ( uint32_t  x)

Definition at line 261 of file helpers.cpp.

◆ reverse_bits_16()

uint16_t esphome::reverse_bits_16 ( uint16_t  x)

Definition at line 193 of file helpers.cpp.

◆ reverse_bits_32()

uint32_t esphome::reverse_bits_32 ( uint32_t  x)

◆ reverse_bits_8()

uint8_t esphome::reverse_bits_8 ( uint8_t  x)

Definition at line 186 of file helpers.cpp.

◆ sanitize_hostname()

std::string esphome::sanitize_hostname ( const std::string &  hostname)

Sanitize the hostname by removing characters that are not in the whitelist and truncating it to 63 chars.

Definition at line 96 of file helpers.cpp.

◆ sanitize_string_whitelist()

std::string esphome::sanitize_string_whitelist ( const std::string &  s,
const std::string &  whitelist 
)

Sanitizes the input string with the whitelist.

Definition at line 88 of file helpers.cpp.

◆ str_endswith()

bool esphome::str_endswith ( const std::string &  full,
const std::string &  ending 
)

Definition at line 291 of file helpers.cpp.

◆ str_equals_case_insensitive()

bool esphome::str_equals_case_insensitive ( const std::string &  a,
const std::string &  b 
)

Compare string a to string b (ignoring case) and return whether they are equal.

Definition at line 257 of file helpers.cpp.

◆ str_startswith()

bool esphome::str_startswith ( const std::string &  full,
const std::string &  start 
)

Definition at line 290 of file helpers.cpp.

◆ swap()

template<typename T >
void esphome::swap ( optional< T > &  x,
optional< T > &  y 
)

Definition at line 208 of file optional.h.

◆ to_lowercase_underscore()

std::string esphome::to_lowercase_underscore ( std::string  s)

Convert the string to lowercase_underscore.

Definition at line 82 of file helpers.cpp.

◆ to_string() [1/10]

std::string esphome::to_string ( const std::string &  val)

Definition at line 196 of file helpers.cpp.

◆ to_string() [2/10]

std::string esphome::to_string ( int  val)

Definition at line 197 of file helpers.cpp.

◆ to_string() [3/10]

std::string esphome::to_string ( long  val)

Definition at line 202 of file helpers.cpp.

◆ to_string() [4/10]

std::string esphome::to_string ( long long  val)

Definition at line 207 of file helpers.cpp.

◆ to_string() [5/10]

std::string esphome::to_string ( unsigned  val)

Definition at line 212 of file helpers.cpp.

◆ to_string() [6/10]

std::string esphome::to_string ( unsigned long  val)

Definition at line 217 of file helpers.cpp.

◆ to_string() [7/10]

std::string esphome::to_string ( unsigned long long  val)

Definition at line 222 of file helpers.cpp.

◆ to_string() [8/10]

std::string esphome::to_string ( float  val)

Definition at line 227 of file helpers.cpp.

◆ to_string() [9/10]

std::string esphome::to_string ( double  val)

Definition at line 232 of file helpers.cpp.

◆ to_string() [10/10]

std::string esphome::to_string ( long double  val)

Definition at line 237 of file helpers.cpp.

◆ truncate_string()

std::string esphome::truncate_string ( const std::string &  s,
size_t  length 
)

Truncate a string to a specific length.

Definition at line 101 of file helpers.cpp.

◆ uint32_to_string()

std::string esphome::uint32_to_string ( uint32_t  num)

Convert a uint32_t to a hex string.

Definition at line 120 of file helpers.cpp.

◆ uint64_to_string()

std::string esphome::uint64_to_string ( uint64_t  num)

Convert a uint64_t to a hex string.

Definition at line 114 of file helpers.cpp.

◆ value_accuracy_to_string()

std::string esphome::value_accuracy_to_string ( float  value,
int8_t  accuracy_decimals 
)

Create a string from a value and an accuracy in decimals.

Definition at line 107 of file helpers.cpp.

Variable Documentation

◆ _SPIFFS_end

uint32_t esphome::_SPIFFS_end

Definition at line 91 of file preferences.cpp.

◆ App

Application esphome::App

Global storage of Application pointer - only one Application can exist.

Definition at line 149 of file application.cpp.

◆ COMPONENT_STATE_CONSTRUCTION

const uint32_t esphome::COMPONENT_STATE_CONSTRUCTION = 0x00

Definition at line 26 of file component.cpp.

◆ COMPONENT_STATE_FAILED

const uint32_t esphome::COMPONENT_STATE_FAILED = 0x03

Definition at line 29 of file component.cpp.

◆ COMPONENT_STATE_LOOP

const uint32_t esphome::COMPONENT_STATE_LOOP = 0x02

Definition at line 28 of file component.cpp.

◆ COMPONENT_STATE_MASK

const uint32_t esphome::COMPONENT_STATE_MASK = 0xFF

Definition at line 25 of file component.cpp.

◆ COMPONENT_STATE_SETUP

const uint32_t esphome::COMPONENT_STATE_SETUP = 0x01

Definition at line 27 of file component.cpp.

◆ global_preferences

ESPPreferences esphome::global_preferences

Definition at line 306 of file preferences.cpp.

◆ global_state

uint32_t esphome::global_state = 0

Definition at line 35 of file component.cpp.

◆ HOSTNAME_CHARACTER_WHITELIST

const char * esphome::HOSTNAME_CHARACTER_WHITELIST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"

The characters that are allowed in a hostname.

Definition at line 157 of file helpers.cpp.

◆ STATUS_LED_ERROR

const uint32_t esphome::STATUS_LED_ERROR = 0x0200

Definition at line 33 of file component.cpp.

◆ STATUS_LED_MASK

const uint32_t esphome::STATUS_LED_MASK = 0xFF00

Definition at line 30 of file component.cpp.

◆ STATUS_LED_OK

const uint32_t esphome::STATUS_LED_OK = 0x0000

Definition at line 31 of file component.cpp.

◆ STATUS_LED_WARNING

const uint32_t esphome::STATUS_LED_WARNING = 0x0100

Definition at line 32 of file component.cpp.