ESPHome 2025.8.0-dev
|
Providing packet encoding functions for exchanging data with a remote host. More...
Namespaces | |
namespace | a01nyub |
namespace | a02yyuw |
namespace | a4988 |
namespace | absolute_humidity |
namespace | ac_dimmer |
namespace | adalight |
namespace | adc |
namespace | adc128s102 |
namespace | addressable_light |
namespace | ade7880 |
namespace | ade7953_base |
namespace | ade7953_i2c |
namespace | ade7953_spi |
namespace | ads1115 |
namespace | ads1118 |
namespace | ags10 |
namespace | aht10 |
namespace | aic3204 |
namespace | airthings_ble |
namespace | airthings_wave_base |
namespace | airthings_wave_mini |
namespace | airthings_wave_plus |
namespace | alarm_control_panel |
namespace | alpha3 |
namespace | am2315c |
namespace | am2320 |
namespace | am43 |
namespace | analog_threshold |
namespace | animation |
namespace | anova |
namespace | apds9306 |
namespace | apds9960 |
namespace | api |
namespace | as3935 |
namespace | as3935_i2c |
namespace | as3935_spi |
namespace | as5600 |
namespace | as7341 |
namespace | at581x |
namespace | atc_mithermometer |
namespace | atm90e26 |
namespace | atm90e32 |
namespace | audio |
namespace | audio_adc |
namespace | audio_dac |
namespace | axs15231 |
namespace | b_parasite |
namespace | ballu |
namespace | bang_bang |
namespace | bedjet |
namespace | beken_spi_led_strip |
namespace | bh1750 |
namespace | binary |
namespace | binary_sensor |
namespace | binary_sensor_map |
namespace | bl0906 |
namespace | bl0939 |
namespace | bl0940 |
namespace | bl0942 |
namespace | ble_client |
namespace | ble_presence |
namespace | ble_rssi |
namespace | ble_scanner |
namespace | bluetooth_proxy |
namespace | bme280_base |
namespace | bme280_i2c |
namespace | bme280_spi |
namespace | bme680 |
namespace | bme680_bsec |
namespace | bme68x_bsec2 |
namespace | bme68x_bsec2_i2c |
namespace | bmi160 |
namespace | bmp085 |
namespace | bmp280_base |
namespace | bmp280_i2c |
namespace | bmp280_spi |
namespace | bmp3xx_base |
namespace | bmp3xx_i2c |
namespace | bmp3xx_spi |
namespace | bmp581 |
namespace | bp1658cj |
namespace | bp5758d |
namespace | button |
namespace | bytebuffer |
namespace | camera |
namespace | canbus |
namespace | cap1188 |
namespace | captive_portal |
namespace | ccs811 |
namespace | cd74hc4067 |
namespace | ch422g |
namespace | chsc6x |
namespace | climate |
namespace | climate_ir |
namespace | climate_ir_lg |
namespace | cm1106 |
namespace | color_temperature |
namespace | combination |
namespace | coolix |
namespace | copy |
namespace | cover |
namespace | cs5460a |
namespace | cse7761 |
namespace | cse7766 |
namespace | cst226 |
namespace | cst816 |
namespace | ct_clamp |
namespace | current_based |
namespace | cwww |
namespace | dac7678 |
namespace | daikin |
namespace | daikin_arc |
namespace | daikin_brc |
namespace | dallas_temp |
namespace | daly_bms |
namespace | dashboard_import |
namespace | datetime |
namespace | debug |
namespace | deep_sleep |
namespace | delonghi |
namespace | demo |
namespace | dfplayer |
namespace | dfrobot_sen0395 |
namespace | dht |
namespace | dht12 |
namespace | display |
namespace | display_menu_base |
namespace | dps310 |
namespace | ds1307 |
namespace | ds2484 |
namespace | dsmr |
namespace | duty_cycle |
namespace | duty_time_sensor |
namespace | e131 |
namespace | ee895 |
namespace | ektf2232 |
namespace | emc2101 |
namespace | emmeti |
namespace | endstop |
namespace | ens160_base |
namespace | ens160_i2c |
namespace | ens160_spi |
namespace | ens210 |
namespace | es7210 |
namespace | es7243e |
namespace | es8156 |
namespace | es8311 |
namespace | es8388 |
namespace | esp32 |
namespace | esp32_ble |
namespace | esp32_ble_beacon |
namespace | esp32_ble_client |
namespace | esp32_ble_server |
namespace | esp32_ble_tracker |
namespace | esp32_camera |
namespace | esp32_camera_web_server |
namespace | esp32_can |
namespace | esp32_dac |
namespace | esp32_improv |
namespace | esp32_rmt_led_strip |
namespace | esp32_touch |
namespace | esp8266 |
namespace | esp8266_pwm |
namespace | esp_ldo |
namespace | espnow |
namespace | ethernet |
namespace | ethernet_info |
namespace | event |
namespace | event_emitter |
namespace | exposure_notifications |
namespace | ezo |
namespace | ezo_pmp |
namespace | factory_reset |
namespace | fan |
namespace | fastled_base |
namespace | feedback |
namespace | fingerprint_grow |
namespace | font |
namespace | fs3000 |
namespace | ft5x06 |
namespace | ft63x6 |
namespace | fujitsu_general |
namespace | gcja5 |
namespace | gdk101 |
namespace | gl_r01_i2c |
namespace | globals |
namespace | gp2y1010au0f |
namespace | gp8403 |
namespace | gpio |
namespace | gpio_expander |
namespace | gps |
namespace | graph |
namespace | graphical_display_menu |
namespace | gree |
namespace | grove_gas_mc_v2 |
namespace | grove_tb6612fng |
namespace | growatt_solar |
namespace | gt911 |
namespace | haier |
namespace | havells_solar |
namespace | hbridge |
namespace | hdc1080 |
namespace | he60r |
namespace | heatpumpir |
namespace | hitachi_ac344 |
namespace | hitachi_ac424 |
namespace | hlw8012 |
namespace | hm3301 |
namespace | hmac_md5 |
namespace | hmc5883l |
namespace | homeassistant |
namespace | honeywell_hih_i2c |
namespace | honeywellabp |
namespace | honeywellabp2_i2c |
namespace | host |
namespace | hrxl_maxsonar_wr |
namespace | hte501 |
namespace | http_request |
namespace | htu21d |
namespace | htu31d |
namespace | hx711 |
namespace | hydreon_rgxx |
namespace | hyt271 |
namespace | i2c |
namespace | i2c_device |
namespace | i2s_audio |
namespace | iaqcore |
namespace | ili9xxx |
namespace | image |
namespace | improv_base |
namespace | improv_serial |
namespace | ina219 |
namespace | ina226 |
namespace | ina260 |
namespace | ina2xx_base |
namespace | ina2xx_i2c |
namespace | ina2xx_spi |
namespace | ina3221 |
namespace | inkbird_ibsth1_mini |
namespace | inkplate6 |
namespace | integration |
namespace | internal |
namespace | internal_temperature |
namespace | interval |
namespace | jsn_sr04t |
namespace | json |
namespace | kamstrup_kmp |
namespace | key_collector |
namespace | key_provider |
namespace | kmeteriso |
namespace | kuntze |
namespace | lc709203f |
namespace | lcd_base |
namespace | lcd_gpio |
namespace | lcd_menu |
namespace | lcd_pcf8574 |
namespace | ld2410 |
namespace | ld2412 |
namespace | ld2420 |
namespace | ld2450 |
namespace | ld24xx |
namespace | ledc |
namespace | libretiny |
namespace | libretiny_pwm |
namespace | light |
namespace | lightwaverf |
namespace | lilygo_t5_47 |
namespace | lock |
namespace | logger |
namespace | lps22 |
namespace | ltr390 |
namespace | ltr501 |
namespace | ltr_als_ps |
namespace | lvgl |
namespace | m5stack_8angle |
namespace | matrix_keypad |
namespace | max17043 |
namespace | max31855 |
namespace | max31856 |
namespace | max31865 |
namespace | max44009 |
namespace | max6675 |
namespace | max6956 |
namespace | max7219 |
namespace | max7219digit |
namespace | max9611 |
namespace | mcp23008 |
namespace | mcp23016 |
namespace | mcp23017 |
namespace | mcp23s08 |
namespace | mcp23s17 |
namespace | mcp23x08_base |
namespace | mcp23x17_base |
namespace | mcp23xxx_base |
namespace | mcp2515 |
namespace | mcp3008 |
namespace | mcp3204 |
namespace | mcp4461 |
namespace | mcp4725 |
namespace | mcp4728 |
namespace | mcp47a1 |
namespace | mcp9600 |
namespace | mcp9808 |
namespace | md5 |
namespace | mdns |
namespace | media_player |
namespace | mhz19 |
namespace | micro_wake_word |
namespace | micronova |
namespace | microphone |
namespace | mics_4514 |
namespace | midea |
namespace | midea_ir |
namespace | mipi_dsi |
namespace | mipi_spi |
namespace | mitsubishi |
namespace | mixer_speaker |
namespace | mlx90393 |
namespace | mlx90614 |
namespace | mmc5603 |
namespace | mmc5983 |
namespace | modbus |
namespace | modbus_controller |
namespace | monochromatic |
namespace | mopeka_ble |
namespace | mopeka_pro_check |
namespace | mopeka_std_check |
namespace | mpl3115a2 |
namespace | mpr121 |
namespace | mpu6050 |
namespace | mpu6886 |
namespace | mqtt |
namespace | mqtt_subscribe |
namespace | ms5611 |
namespace | ms8607 |
namespace | msa3xx |
namespace | my9231 |
namespace | nau7802 |
namespace | neopixelbus |
namespace | network |
namespace | nextion |
namespace | nfc |
namespace | noblex |
namespace | npi19 |
namespace | ntc |
namespace | number |
namespace | one_wire |
namespace | online_image |
namespace | opentherm |
namespace | openthread |
namespace | openthread_info |
namespace | opt3001 |
namespace | ota |
namespace | output |
namespace | packet_transport |
namespace | partition |
namespace | pca6416a |
namespace | pca9554 |
namespace | pca9685 |
namespace | pcd8544 |
namespace | pcf85063 |
namespace | pcf8563 |
namespace | pcf8574 |
namespace | pi4ioe5v6408 |
namespace | pid |
namespace | pipsolar |
namespace | pm1006 |
namespace | pm2005 |
namespace | pmsa003i |
namespace | pmsx003 |
namespace | pmwcs3 |
namespace | pn532 |
namespace | pn532_i2c |
namespace | pn532_spi |
namespace | pn7150 |
namespace | pn7150_i2c |
namespace | pn7160 |
namespace | pn7160_i2c |
namespace | pn7160_spi |
namespace | power_supply |
namespace | preferences |
namespace | prometheus |
namespace | psram |
namespace | pulse_counter |
namespace | pulse_meter |
namespace | pulse_width |
namespace | pvvx_mithermometer |
namespace | pylontech |
namespace | pzem004t |
namespace | pzemac |
namespace | pzemdc |
namespace | qmc5883l |
namespace | qmp6988 |
namespace | qr_code |
namespace | qspi_dbi |
namespace | qwiic_pir |
namespace | radon_eye_ble |
namespace | radon_eye_rd200 |
namespace | rc522 |
namespace | rc522_i2c |
namespace | rc522_spi |
Library based on https://github.com/miguelbalboa/rfid and adapted to ESPHome by @glmnet. | |
namespace | rdm6300 |
namespace | remote_base |
namespace | remote_receiver |
namespace | remote_transmitter |
namespace | resampler |
namespace | resistance |
namespace | restart |
namespace | rf_bridge |
namespace | rgb |
namespace | rgbct |
namespace | rgbw |
namespace | rgbww |
namespace | rotary_encoder |
namespace | rp2040 |
namespace | rp2040_pio_led_strip |
namespace | rp2040_pwm |
namespace | rpi_dpi_rgb |
namespace | rtttl |
namespace | runtime_stats |
namespace | ruuvi_ble |
namespace | ruuvitag |
namespace | safe_mode |
namespace | scd30 |
namespace | scd4x |
namespace | script |
namespace | sdl |
namespace | sdm_meter |
namespace | sdp3x |
namespace | sds011 |
namespace | seeed_mr24hpc1 |
namespace | seeed_mr60bha2 |
namespace | seeed_mr60fda2 |
namespace | selec_meter |
namespace | select |
namespace | sen0321_sensor |
namespace | sen21231_sensor |
namespace | sen5x |
namespace | senseair |
namespace | sensirion_common |
namespace | sensor |
namespace | servo |
namespace | setup_priority |
Default setup priorities for components of different types. | |
namespace | sfa30 |
namespace | sgp30 |
namespace | sgp4x |
namespace | shelly_dimmer |
namespace | sht3xd |
namespace | sht4x |
namespace | shtcx |
namespace | shutdown |
namespace | sigma_delta_output |
namespace | sim800l |
namespace | slow_pwm |
namespace | sm10bit_base |
namespace | sm16716 |
namespace | sm2135 |
namespace | sm2235 |
namespace | sm2335 |
namespace | sm300d2 |
namespace | sml |
namespace | smt100 |
namespace | sn74hc165 |
namespace | sn74hc595 |
namespace | sntp |
namespace | socket |
namespace | sonoff_d1 |
namespace | sound_level |
namespace | speaker |
namespace | speed |
namespace | spi |
namespace | spi_device |
namespace | spi_led_strip |
namespace | sprinkler |
namespace | sps30 |
namespace | ssd1306_base |
namespace | ssd1306_i2c |
namespace | ssd1306_spi |
namespace | ssd1322_base |
namespace | ssd1322_spi |
namespace | ssd1325_base |
namespace | ssd1325_spi |
namespace | ssd1327_base |
namespace | ssd1327_i2c |
namespace | ssd1327_spi |
namespace | ssd1331_base |
namespace | ssd1331_spi |
namespace | ssd1351_base |
namespace | ssd1351_spi |
namespace | st7567_base |
namespace | st7567_i2c |
namespace | st7567_spi |
namespace | st7701s |
namespace | st7735 |
namespace | st7789v |
namespace | st7920 |
namespace | statsd |
namespace | status |
namespace | status_led |
namespace | stepper |
namespace | sts3x |
namespace | sun |
namespace | sun_gtil2 |
namespace | switch_ |
namespace | sx126x |
namespace | sx127x |
namespace | sx1509 |
Here you'll find the Arduino code used to interface with the SX1509 I2C 16 I/O expander. | |
namespace | syslog |
namespace | t6615 |
namespace | tc74 |
namespace | tca9548a |
namespace | tca9555 |
namespace | tcl112 |
namespace | tcs34725 |
namespace | tee501 |
namespace | teleinfo |
namespace | tem3200 |
namespace | template_ |
namespace | text |
namespace | text_sensor |
namespace | thermostat |
namespace | time |
namespace | time_based |
namespace | tlc59208f |
namespace | tlc5947 |
namespace | tlc5971 |
namespace | tm1621 |
namespace | tm1637 |
namespace | tm1638 |
namespace | tm1651 |
namespace | tmp102 |
namespace | tmp1075 |
namespace | tmp117 |
namespace | tof10120 |
namespace | tormatic |
namespace | toshiba |
namespace | total_daily_energy |
namespace | touchscreen |
namespace | tsl2561 |
namespace | tsl2591 |
namespace | tt21100 |
namespace | ttp229_bsf |
namespace | ttp229_lsf |
namespace | tuya |
namespace | tx20 |
namespace | uart |
namespace | udp |
namespace | ufire_ec |
namespace | ufire_ise |
namespace | uln2003 |
namespace | ultrasonic |
namespace | update |
namespace | uponor_smatrix |
namespace | uptime |
namespace | usb_host |
namespace | usb_uart |
namespace | valve |
namespace | vbus |
namespace | veml3235 |
namespace | veml7700 |
namespace | version |
namespace | vl53l0x |
namespace | voice_assistant |
namespace | voltage_sampler |
namespace | wake_on_lan |
namespace | watchdog |
namespace | waveshare_epaper |
namespace | web_server |
namespace | web_server_base |
namespace | web_server_idf |
namespace | weikai |
namespace | weikai_i2c |
namespace | weikai_spi |
namespace | whirlpool |
namespace | whynter |
namespace | wiegand |
namespace | wifi |
namespace | wifi_info |
namespace | wifi_signal |
namespace | wireguard |
namespace | wk2132_i2c |
namespace | wl_134 |
namespace | wled |
namespace | x9c |
namespace | xgzp68xx |
namespace | xiaomi_ble |
namespace | xiaomi_cgd1 |
namespace | xiaomi_cgdk2 |
namespace | xiaomi_cgg1 |
namespace | xiaomi_cgpr1 |
namespace | xiaomi_gcls002 |
namespace | xiaomi_hhccjcy01 |
namespace | xiaomi_hhccjcy10 |
namespace | xiaomi_hhccpot002 |
namespace | xiaomi_jqjcy01ym |
namespace | xiaomi_lywsd02 |
namespace | xiaomi_lywsd02mmc |
namespace | xiaomi_lywsd03mmc |
namespace | xiaomi_lywsdcgq |
namespace | xiaomi_mhoc303 |
namespace | xiaomi_mhoc401 |
namespace | xiaomi_miscale |
namespace | xiaomi_mjyd02yla |
namespace | xiaomi_mue4094rt |
namespace | xiaomi_rtcgq02lm |
namespace | xiaomi_wx08zm |
namespace | xiaomi_xmwsdj04mmc |
namespace | xl9535 |
namespace | xpt2046 |
namespace | xxtea |
namespace | yashima |
namespace | zephyr |
namespace | zhlt01 |
namespace | zio_ultrasonic |
namespace | zyaura |
Data Structures | |
class | Action |
class | ActionList |
class | AndCondition |
class | Application |
class | Area |
class | Automation |
class | CallbackManager |
class | CallbackManager< void(Ts...)> |
Helper class to allow having multiple subscribers to a callback. More... | |
struct | Color |
class | Component |
class | ComponentIterator |
class | Condition |
Base class for all automation conditions. More... | |
class | Controller |
class | Deduplicator |
Helper class to deduplicate items in a series of values. More... | |
class | DelayAction |
class | Device |
class | EntityBase |
class | EntityBase_DeviceClass |
class | EntityBase_UnitOfMeasurement |
class | ESPHomeOTAComponent |
ESPHomeOTAComponent provides a simple way to integrate Over-the-Air updates into your app using ArduinoOTA. More... | |
class | ESPPreferenceBackend |
class | ESPPreferenceObject |
class | ESPPreferences |
struct | ESPTime |
A more user-friendly version of struct tm from time.h. More... | |
class | EventPool |
class | ForCondition |
struct | gens |
struct | gens< 0, S... > |
class | GPIOPin |
class | HighFrequencyLoopRequester |
Helper class to request loop() to be called as fast as possible. More... | |
class | IfAction |
struct | int24_t |
24-bit signed integer type, transparently converting to 32-bit. More... | |
class | InternalGPIOPin |
class | InterruptLock |
Helper class to disable interrupts. More... | |
class | ISRInternalGPIOPin |
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions) More... | |
class | LambdaAction |
class | LambdaCondition |
class | LockFreeQueue |
class | LockGuard |
Helper class that wraps a mutex with a RAII-style API. More... | |
class | LoopTrigger |
class | LwIPLock |
Helper class to lock the lwIP TCPIP core when making lwIP API calls from non-TCPIP threads. More... | |
class | Mutex |
Mutex implementation, with API based on the unavailable std::mutex. More... | |
class | NotCondition |
class | NotifyingLockFreeQueue |
struct | nullopt_t |
class | optional |
class | OrCondition |
class | Parented |
Helper class to easily give an object a parent of type T . More... | |
class | PollingComponent |
This class simplifies creating components that periodically check a state. More... | |
class | ProjectUpdateTrigger |
class | RAMAllocator |
An STL allocator that uses SPI or internal RAM. More... | |
class | RepeatAction |
class | ResumeComponentAction |
class | RingBuffer |
class | Scheduler |
struct | seq |
class | ShutdownTrigger |
class | StartupTrigger |
class | StatefulEntityBase |
An entity that has a state. More... | |
class | StaticVector |
Minimal static vector - saves memory by avoiding std::vector overhead. More... | |
class | StringRef |
StringRef is a reference to a string owned by something else. More... | |
class | SuspendComponentAction |
class | TemplatableValue |
class | Trigger |
struct | uint24_t |
24-bit unsigned integer type, transparently converting to 32-bit. More... | |
class | UpdateComponentAction |
class | WaitUntilAction |
class | WarnIfComponentBlockingGuard |
class | WhileAction |
class | XorCondition |
Typedefs | |
using | uint64_be_t = internal::BigEndianLayout<uint64_t> |
using | uint32_be_t = internal::BigEndianLayout<uint32_t> |
using | uint24_be_t = internal::BigEndianLayout<uint24_t> |
using | uint16_be_t = internal::BigEndianLayout<uint16_t> |
using | int64_be_t = internal::BigEndianLayout<int64_t> |
using | int32_be_t = internal::BigEndianLayout<int32_t> |
using | int24_be_t = internal::BigEndianLayout<int24_t> |
using | int16_be_t = internal::BigEndianLayout<int16_t> |
using | uint64_le_t = internal::LittleEndianLayout<uint64_t> |
using | uint32_le_t = internal::LittleEndianLayout<uint32_t> |
using | uint24_le_t = internal::LittleEndianLayout<uint24_t> |
using | uint16_le_t = internal::LittleEndianLayout<uint16_t> |
using | int64_le_t = internal::LittleEndianLayout<int64_t> |
using | int32_le_t = internal::LittleEndianLayout<int32_t> |
using | int24_le_t = internal::LittleEndianLayout<int24_t> |
using | int16_le_t = internal::LittleEndianLayout<int16_t> |
Memory management | |
template<class T > | |
using | ExternalRAMAllocator = RAMAllocator<T> |
Enumerations | |
enum class | RetryResult { DONE , RETRY } |
enum | EntityCategory : uint8_t { ENTITY_CATEGORY_NONE = 0 , ENTITY_CATEGORY_CONFIG = 1 , ENTITY_CATEGORY_DIAGNOSTIC = 2 } |
Functions | |
void IRAM_ATTR HOT | yield () |
uint32_t IRAM_ATTR HOT | millis () |
void IRAM_ATTR HOT | delay (uint32_t ms) |
uint32_t IRAM_ATTR HOT | micros () |
void IRAM_ATTR HOT | delayMicroseconds (uint32_t us) |
void | arch_restart () |
void | arch_init () |
void IRAM_ATTR HOT | arch_feed_wdt () |
uint8_t | progmem_read_byte (const uint8_t *addr) |
uint32_t | arch_get_cpu_cycle_count () |
uint32_t | arch_get_cpu_freq_hz () |
void | loop_task (void *pv_params) |
void | app_main () |
void | init () |
void | force_link_symbols () |
void | resetPins () |
void | clear_setup_priority_overrides () |
struct esphome::uint24_t | __attribute__ ((packed)) |
void | __attribute__ ((noreturn)) arch_restart() |
template<int(*)(int) fn> | |
std::string | str_ctype_transform (const std::string &str) |
std::string | str_snprintf (const char *fmt, size_t len,...) |
std::string | str_sprintf (const char *fmt,...) |
std::string | format_mac_address_pretty (const uint8_t *mac) |
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) noexcept |
template<typename T > | |
optional< T > | make_optional (T const &v) |
void | retry_handler (const std::shared_ptr< RetryArgs > &args) |
void | convertToJson (const StringRef &src, JsonVariant dst) |
bool | operator== (const StringRef &lhs, const StringRef &rhs) |
bool | operator== (const StringRef &lhs, const std::string &rhs) |
bool | operator== (const std::string &lhs, const StringRef &rhs) |
bool | operator== (const StringRef &lhs, const char *rhs) |
bool | operator== (const char *lhs, const StringRef &rhs) |
bool | operator!= (const StringRef &lhs, const StringRef &rhs) |
bool | operator!= (const StringRef &lhs, const std::string &rhs) |
bool | operator!= (const std::string &lhs, const StringRef &rhs) |
bool | operator!= (const StringRef &lhs, const char *rhs) |
bool | operator!= (const char *lhs, const StringRef &rhs) |
bool | operator< (const StringRef &lhs, const StringRef &rhs) |
std::string & | operator+= (std::string &lhs, const StringRef &rhs) |
std::string | operator+ (const char *lhs, const StringRef &rhs) |
std::string | operator+ (const StringRef &lhs, const char *rhs) |
uint8_t | days_in_month (uint8_t month, uint16_t year) |
template<typename T > | |
bool | increment_time_value (T ¤t, uint16_t begin, uint16_t end) |
bool | api_is_connected () |
Return whether the node has at least one client connected to the native API. | |
bool | mqtt_is_connected () |
Return whether the node has an active connection to an MQTT broker. | |
bool | remote_is_connected () |
Return whether the node has any form of "remote" connection via the API or to an MQTT broker. | |
Mathematics | |
uint32_t | random_uint32 () |
Return a random 32-bit unsigned integer. | |
bool | random_bytes (uint8_t *data, size_t len) |
Generate len number of random bytes. | |
uint8_t | crc8 (const uint8_t *data, uint8_t len) |
Calculate a CRC-8 checksum of data with size len using the CRC-8-Dallas/Maxim polynomial. | |
uint16_t | crc16 (const uint8_t *data, uint16_t len, uint16_t crc=0xffff, uint16_t reverse_poly=0xa001, bool refin=false, bool refout=false) |
Calculate a CRC-16 checksum of data with size len . | |
uint16_t | crc16be (const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly, bool refin, bool refout) |
uint32_t | fnv1_hash (const std::string &str) |
Calculate a FNV-1 hash of str . | |
float | random_float () |
Return a random float between 0 and 1. | |
template<typename T , typename U > | |
T | remap (U value, U min, U max, T min_out, T max_out) |
Remap value from the range (min , max ) to (min_out , max_out ). | |
System APIs | |
void | get_mac_address_raw (uint8_t *mac) |
Get the device MAC address as raw bytes, written into the provided byte array (6 bytes). | |
void | set_mac_address (uint8_t *mac) |
Set the MAC address to use from the provided byte array (6 bytes). | |
bool | has_custom_mac_address () |
Check if a custom MAC address is set (ESP32 & variants) | |
std::string | get_mac_address () |
Get the device MAC address as a string, in lowercase hex notation. | |
std::string | get_mac_address_pretty () |
Get the device MAC address as a string, in colon-separated uppercase hex notation. | |
bool | mac_address_is_valid (const uint8_t *mac) |
Check if the MAC address is not all zeros or all ones. | |
void IRAM_ATTR HOT | delay_microseconds_safe (uint32_t us) |
Delay for the given amount of microseconds, possibly yielding to other processes during the wait. | |
Colors | |
float | gamma_correct (float value, float gamma) |
Applies gamma correction of gamma to value . | |
float | gamma_uncorrect (float value, float gamma) |
Reverts gamma correction of gamma to value . | |
void | rgb_to_hsv (float red, float green, float blue, int &hue, float &saturation, float &value) |
Convert red , green and blue (all 0-1) values to hue (0-360), saturation (0-1) and value (0-1). | |
void | hsv_to_rgb (int hue, float saturation, float value, float &red, float &green, float &blue) |
Convert hue (0-360), saturation (0-1) and value (0-1) to red , green and blue (all 0-1). | |
STL backports | |
template<typename To , typename From , enable_if_t< sizeof(To)==sizeof(From) &&is_trivially_copyable< From >::value &&is_trivially_copyable< To >::value, int > = 0> | |
To | bit_cast (const From &src) |
Convert data between types, without aliasing issues or undefined behaviour. | |
float | lerp (float completion, float start, float end)=delete |
template<typename T > | |
constexpr T | byteswap (T n) |
template<> | |
constexpr uint8_t | byteswap (uint8_t n) |
template<> | |
constexpr uint16_t | byteswap (uint16_t n) |
template<> | |
constexpr uint32_t | byteswap (uint32_t n) |
template<> | |
constexpr uint64_t | byteswap (uint64_t n) |
template<> | |
constexpr int8_t | byteswap (int8_t n) |
template<> | |
constexpr int16_t | byteswap (int16_t n) |
template<> | |
constexpr int32_t | byteswap (int32_t n) |
template<> | |
constexpr int64_t | byteswap (int64_t n) |
Bit manipulation | |
constexpr uint16_t | encode_uint16 (uint8_t msb, uint8_t lsb) |
Encode a 16-bit value given the most and least significant byte. | |
constexpr uint32_t | encode_uint24 (uint8_t byte1, uint8_t byte2, uint8_t byte3) |
Encode a 24-bit value given three bytes in most to least significant byte order. | |
constexpr uint32_t | encode_uint32 (uint8_t byte1, uint8_t byte2, uint8_t byte3, uint8_t byte4) |
Encode a 32-bit value given four bytes in most to least significant byte order. | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
constexpr T | encode_value (const uint8_t *bytes) |
Encode a value from its constituent bytes (from most to least significant) in an array with length sizeof(T). | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
constexpr T | encode_value (const std::array< uint8_t, sizeof(T)> bytes) |
Encode a value from its constituent bytes (from most to least significant) in an std::array with length sizeof(T). | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
constexpr std::array< uint8_t, sizeof(T)> | decode_value (T val) |
Decode a value into its constituent bytes (from most to least significant). | |
uint8_t | reverse_bits (uint8_t x) |
Reverse the order of 8 bits. | |
uint16_t | reverse_bits (uint16_t x) |
Reverse the order of 16 bits. | |
uint32_t | reverse_bits (uint32_t x) |
Reverse the order of 32 bits. | |
template<typename T > | |
constexpr T | convert_big_endian (T val) |
Convert a value between host byte order and big endian (most significant byte first) order. | |
template<typename T > | |
constexpr T | convert_little_endian (T val) |
Convert a value between host byte order and little endian (least significant byte first) order. | |
Units | |
constexpr float | celsius_to_fahrenheit (float value) |
Convert degrees Celsius to degrees Fahrenheit. | |
constexpr float | fahrenheit_to_celsius (float value) |
Convert degrees Fahrenheit to degrees Celsius. | |
Internal functions | |
template<typename T , enable_if_t<!std::is_pointer< T >::value, int > = 0> | |
T | id (T value) |
Helper function to make id(var) known from lambdas work in custom components. | |
template<typename T , enable_if_t< std::is_pointer< T * >::value, int > = 0> | |
T & | id (T *value) |
Helper function to make id(var) known from lambdas work in custom components. | |
Deprecated functions | |
ESPDEPRECATED ("hexencode() is deprecated, use format_hex_pretty() instead.", "2022.1") inline std | |
template<typename T > | |
ESPDEPRECATED ("hexencode() is deprecated, use format_hex_pretty() instead.", "2022.1") std | |
Variables | |
TaskHandle_t | loop_task_handle = nullptr |
ESPPreferences * | global_preferences |
runtime_stats::RuntimeStatsCollector * | global_runtime_stats |
Application | App |
Global storage of Application pointer - only one Application can exist. | |
const uint8_t | COMPONENT_STATE_MASK = 0x07 |
const uint8_t | COMPONENT_STATE_CONSTRUCTION = 0x00 |
const uint8_t | COMPONENT_STATE_SETUP = 0x01 |
const uint8_t | COMPONENT_STATE_LOOP = 0x02 |
const uint8_t | COMPONENT_STATE_FAILED = 0x03 |
const uint8_t | COMPONENT_STATE_LOOP_DONE = 0x04 |
const uint8_t | STATUS_LED_MASK = 0x18 |
const uint8_t | STATUS_LED_OK = 0x00 |
const uint8_t | STATUS_LED_WARNING = 0x08 |
const uint8_t | STATUS_LED_ERROR = 0x10 |
const uint16_t | WARN_IF_BLOCKING_OVER_MS = 50U |
Initial blocking time allowed without warning. | |
const uint16_t | WARN_IF_BLOCKING_INCREMENT_MS = 10U |
How long the blocking time must be larger to warn again. | |
uint32_t | global_state = 0 |
Parsing & formatting | |
enum | ParseOnOffState : uint8_t { PARSE_NONE = 0 , PARSE_ON , PARSE_OFF , PARSE_TOGGLE } |
Return values for parse_on_off(). More... | |
size_t | parse_hex (const char *str, size_t len, uint8_t *data, size_t count) |
Parse bytes from a hex-encoded string into a byte array. | |
std::string | format_hex (const uint8_t *data, size_t length) |
Format the byte array data of length len in lowercased hex. | |
std::string | format_hex (const std::vector< uint8_t > &data) |
Format the vector data in lowercased hex. | |
std::string | format_hex_pretty (const uint8_t *data, size_t length, char separator='.', bool show_length=true) |
Format a byte array in pretty-printed, human-readable hex format. | |
std::string | format_hex_pretty (const std::vector< uint8_t > &data, char separator='.', bool show_length=true) |
Format a byte vector in pretty-printed, human-readable hex format. | |
std::string | format_hex_pretty (const uint16_t *data, size_t length, char separator='.', bool show_length=true) |
Format a 16-bit word array in pretty-printed, human-readable hex format. | |
std::string | format_hex_pretty (const std::vector< uint16_t > &data, char separator='.', bool show_length=true) |
Format a 16-bit word vector in pretty-printed, human-readable hex format. | |
std::string | format_hex_pretty (const std::string &data, char separator='.', bool show_length=true) |
Format a string's bytes in pretty-printed, human-readable hex format. | |
std::string | format_bin (const uint8_t *data, size_t length) |
Format the byte array data of length len in binary. | |
ParseOnOffState | parse_on_off (const char *str, const char *on=nullptr, const char *off=nullptr) |
Parse a string that contains either on, off or toggle. | |
std::string | value_accuracy_to_string (float value, int8_t accuracy_decimals) |
Create a string from a value and an accuracy in decimals. | |
int8_t | step_to_accuracy_decimals (float step) |
Derive accuracy in decimals from an increment step. | |
std::string | base64_encode (const std::vector< uint8_t > &buf) |
std::string | base64_encode (const uint8_t *buf, size_t buf_len) |
size_t | base64_decode (const std::string &encoded_string, uint8_t *buf, size_t buf_len) |
std::vector< uint8_t > | base64_decode (const std::string &encoded_string) |
template<typename T , enable_if_t<(std::is_integral< T >::value &&std::is_unsigned< T >::value), int > = 0> | |
optional< T > | parse_number (const char *str) |
Parse an unsigned decimal number from a null-terminated string. | |
template<typename T , enable_if_t<(std::is_integral< T >::value &&std::is_unsigned< T >::value), int > = 0> | |
optional< T > | parse_number (const std::string &str) |
Parse an unsigned decimal number. | |
bool | parse_hex (const char *str, uint8_t *data, size_t count) |
Parse count bytes from the hex-encoded string str of at least 2*count characters into array data . | |
bool | parse_hex (const std::string &str, uint8_t *data, size_t count) |
Parse count bytes from the hex-encoded string str of at least 2*count characters into array data . | |
bool | parse_hex (const char *str, std::vector< uint8_t > &data, size_t count) |
Parse count bytes from the hex-encoded string str of at least 2*count characters into vector data . | |
bool | parse_hex (const std::string &str, std::vector< uint8_t > &data, size_t count) |
Parse count bytes from the hex-encoded string str of at least 2*count characters into vector data . | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
optional< T > | parse_hex (const char *str, size_t len) |
Parse a hex-encoded string into an unsigned integer. | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
optional< T > | parse_hex (const char *str) |
Parse a hex-encoded null-terminated string (starting with the most significant byte) into an unsigned integer. | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
optional< T > | parse_hex (const std::string &str) |
Parse a hex-encoded null-terminated string (starting with the most significant byte) into an unsigned integer. | |
std::string | format_mac_address_pretty (const uint8_t mac[6]) |
Format the six-byte array mac into a MAC address. | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
std::string | format_hex (T val) |
Format an unsigned integer in lowercased hex, starting with the most significant byte. | |
template<std::size_t N> | |
std::string | format_hex (const std::array< uint8_t, N > &data) |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
std::string | format_hex_pretty (T val, char separator='.', bool show_length=true) |
Format an unsigned integer in pretty-printed, human-readable hex format. | |
template<typename T , enable_if_t< std::is_unsigned< T >::value, int > = 0> | |
std::string | format_bin (T val) |
Format an unsigned integer in binary, starting with the most significant byte. | |
Strings | |
std::string size_t | len |
bool | str_equals_case_insensitive (const std::string &a, const std::string &b) |
Compare strings for equality in case-insensitive manner. | |
bool | str_startswith (const std::string &str, const std::string &start) |
Check whether a string starts with a value. | |
bool | str_endswith (const std::string &str, const std::string &end) |
Check whether a string ends with a value. | |
std::string | str_truncate (const std::string &str, size_t length) |
Truncate a string to a specific length. | |
std::string | str_until (const char *str, char ch) |
Extract the part of the string until either the first occurrence of the specified character, or the end (requires str to be null-terminated). | |
std::string | str_until (const std::string &str, char ch) |
Extract the part of the string until either the first occurrence of the specified character, or the end. | |
std::string | str_lower_case (const std::string &str) |
Convert the string to lower case. | |
std::string | str_upper_case (const std::string &str) |
Convert the string to upper case. | |
std::string | str_snake_case (const std::string &str) |
Convert the string to snake case (lowercase with underscores). | |
std::string | str_sanitize (const std::string &str) |
Sanitizes the input string by removing all characters but alphanumerics, dashes and underscores. | |
std::string | __attribute__ ((format(printf, 1, 3))) str_snprintf(const char *fmt |
snprintf-like function returning std::string of maximum length len (excluding null terminator). | |
std::string size_t std::string | __attribute__ ((format(printf, 1, 2))) str_sprintf(const char *fmt |
sprintf-like function returning std::string. | |
Providing packet encoding functions for exchanging data with a remote host.
When the TEST_COMPONENT flag is defined we include some auto-test methods.
This file implements the UART protocol spoken over the on-board Micro-USB (Type B) connector of Tormatic and Novoferm gates manufactured as of 2016.
Implementation of SPI Controller mode.
Author: Gustavo Ambrozio Based on work by: Atsushi Sasaki (https://github.com/aselectroworks/Arduino-FT6336U)
A transport is required to send the data; this is provided by a child class. The child class should implement the virtual functions send_packet_ and get_max_packet_size_. On receipt of a data packet, it should call this->process_()
with the data.
All communication is initiated by the component. The unit doesn't send data without being asked first.
There are two main message types: status requests and commands.
Querying the gate's status:
| sequence | length | type | payload | | 0xF3 0xCB | 0x00 0x00 0x00 0x06 | 0x01 0x04 | 0x00 0x0A 0x00 0x01 | | 0xF3 0xCB | 0x00 0x00 0x00 0x05 | 0x01 0x04 | 0x02 0x03 0x00 |
This request asks for the gate status (0x0A); the only other value observed in the request was 0x0B, but replies were always zero. Presumably this queries another sensor on the unit like a safety breaker, but this is not relevant for an esphome cover component.
The second byte of the reply is set to 0x03 when the gate is in fully open position. Other valid values for the second byte are: (0x0) Paused, (0x1) Closed, (0x2) Ventilating, (0x3) Opened, (0x4) Opening, (0x5) Closing. The meaning of the other bytes is currently unknown and ignored by the component.
Controlling the gate:
| sequence | length | type | payload | | 0x40 0xFF | 0x00 0x00 0x00 0x06 | 0x01 0x06 | 0x00 0x0A 0x00 0x03 | | 0x40 0xFF | 0x00 0x00 0x00 0x06 | 0x01 0x06 | 0x00 0x0A 0x00 0x03 |
The unit acks any commands by echoing back the message in full. However, this does not mean the gate has started closing. The component only considers status replies as authoritative and simply fires off commands, ignoring the echoed messages.
The payload structure is as follows: [0x00, 0x0A] (gate), followed by one of the states normally carried in status replies: (0x0) Pause, (0x1) Close, (0x2) Ventilate (open ~20%), (0x3) Open/high-torque reverse. The protocol implementation in this file simply reuses the GateStatus enum for this purpose.
Used to test the software during development but can also be used in situ to test if the component is working correctly. For release we do not set it by default but you can set it by using the following lines in you configuration file:
using esphome::ExternalRAMAllocator = RAMAllocator<T> |
using esphome::int16_be_t = internal::BigEndianLayout<int16_t> |
Definition at line 51 of file datatypes.h.
using esphome::int16_le_t = internal::LittleEndianLayout<int16_t> |
Definition at line 59 of file datatypes.h.
Definition at line 50 of file datatypes.h.
Definition at line 58 of file datatypes.h.
using esphome::int32_be_t = internal::BigEndianLayout<int32_t> |
Definition at line 49 of file datatypes.h.
using esphome::int32_le_t = internal::LittleEndianLayout<int32_t> |
Definition at line 57 of file datatypes.h.
using esphome::int64_be_t = internal::BigEndianLayout<int64_t> |
Definition at line 48 of file datatypes.h.
using esphome::int64_le_t = internal::LittleEndianLayout<int64_t> |
Definition at line 56 of file datatypes.h.
using esphome::uint16_be_t = internal::BigEndianLayout<uint16_t> |
Definition at line 47 of file datatypes.h.
using esphome::uint16_le_t = internal::LittleEndianLayout<uint16_t> |
Definition at line 55 of file datatypes.h.
Definition at line 46 of file datatypes.h.
Definition at line 54 of file datatypes.h.
using esphome::uint32_be_t = internal::BigEndianLayout<uint32_t> |
Definition at line 45 of file datatypes.h.
using esphome::uint32_le_t = internal::LittleEndianLayout<uint32_t> |
Definition at line 53 of file datatypes.h.
using esphome::uint64_be_t = internal::BigEndianLayout<uint64_t> |
Definition at line 44 of file datatypes.h.
using esphome::uint64_le_t = internal::LittleEndianLayout<uint64_t> |
Definition at line 52 of file datatypes.h.
enum esphome::EntityCategory : uint8_t |
Enumerator | |
---|---|
ENTITY_CATEGORY_NONE | |
ENTITY_CATEGORY_CONFIG | |
ENTITY_CATEGORY_DIAGNOSTIC |
Definition at line 15 of file entity_base.h.
enum esphome::ParseOnOffState : uint8_t |
Return values for parse_on_off().
Enumerator | |
---|---|
PARSE_NONE | |
PARSE_ON | |
PARSE_OFF | |
PARSE_TOGGLE |
|
strong |
Enumerator | |
---|---|
DONE | |
RETRY |
Definition at line 67 of file component.h.
std::string size_t std::string esphome::__attribute__ | ( | (format(printf, 1, 2)) | ) | const |
sprintf-like function returning std::string.
std::string esphome::__attribute__ | ( | (format(printf, 1, 3)) | ) | const |
snprintf-like function returning std::string of maximum length len
(excluding null terminator).
void esphome::__attribute__ | ( | (noreturn) | ) |
struct esphome::int24_t esphome::__attribute__ | ( | (packed) | ) |
bool esphome::api_is_connected | ( | ) |
std::vector< uint8_t > esphome::base64_decode | ( | const std::string & | encoded_string | ) |
Definition at line 434 of file helpers.cpp.
size_t esphome::base64_decode | ( | const std::string & | encoded_string, |
uint8_t * | buf, | ||
size_t | buf_len ) |
Definition at line 424 of file helpers.cpp.
std::string esphome::base64_encode | ( | const std::vector< uint8_t > & | buf | ) |
Definition at line 382 of file helpers.cpp.
std::string esphome::base64_encode | ( | const uint8_t * | buf, |
size_t | buf_len ) |
Definition at line 384 of file helpers.cpp.
To esphome::bit_cast | ( | const From & | src | ) |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
void esphome::clear_setup_priority_overrides | ( | ) |
Definition at line 432 of file component.cpp.
|
constexpr |
|
constexpr |
void esphome::convertToJson | ( | const StringRef & | src, |
JsonVariant | dst ) |
Definition at line 8 of file string_ref.cpp.
uint16_t esphome::crc16 | ( | const uint8_t * | data, |
uint16_t | len, | ||
uint16_t | crc, | ||
uint16_t | reverse_poly, | ||
bool | refin, | ||
bool | refout ) |
Calculate a CRC-16 checksum of data
with size len
.
Definition at line 60 of file helpers.cpp.
uint16_t esphome::crc16be | ( | const uint8_t * | data, |
uint16_t | len, | ||
uint16_t | crc, | ||
uint16_t | poly, | ||
bool | refin, | ||
bool | refout ) |
Definition at line 100 of file helpers.cpp.
uint8_t esphome::crc8 | ( | const uint8_t * | data, |
uint8_t | len ) |
Calculate a CRC-8 checksum of data
with size len
using the CRC-8-Dallas/Maxim polynomial.
Definition at line 44 of file helpers.cpp.
uint8_t esphome::days_in_month | ( | uint8_t | month, |
uint16_t | year ) |
|
constexpr |
void esphome::delay_microseconds_safe | ( | uint32_t | us | ) |
Delay for the given amount of microseconds, possibly yielding to other processes during the wait.
Definition at line 611 of file helpers.cpp.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
int esphome::esp_idf_log_vprintf_ | ( | const char * | format, |
va_list | args ) |
void void esphome::esp_log_printf_ | ( | int | level, |
const char * | tag, | ||
int | line, | ||
const __FlashStringHelper * | format, | ||
... ) |
void esphome::esp_log_printf_ | ( | int | level, |
const char * | tag, | ||
int | line, | ||
const char * | format, | ||
... ) |
void esphome::esp_log_vprintf_ | ( | int | level, |
const char * | tag, | ||
int | line, | ||
const __FlashStringHelper * | format, | ||
va_list | args ) |
void esphome::esp_log_vprintf_ | ( | int | level, |
const char * | tag, | ||
int | line, | ||
const char * | format, | ||
va_list | args ) |
esphome::ESPDEPRECATED | ( | "hexencode() is | deprecated, |
use format_hex_pretty() instead." | , | ||
"2022.1" | ) |
esphome::ESPDEPRECATED | ( | "hexencode() is | deprecated, |
use format_hex_pretty() instead." | , | ||
"2022.1" | ) |
|
constexpr |
uint32_t esphome::fnv1_hash | ( | const std::string & | str | ) |
Calculate a FNV-1 hash of str
.
Definition at line 134 of file helpers.cpp.
std::string esphome::format_bin | ( | const uint8_t * | data, |
size_t | length ) |
Format the byte array data
of length len
in binary.
Definition at line 312 of file helpers.cpp.
std::string esphome::format_bin | ( | T | val | ) |
std::string esphome::format_hex | ( | const std::array< uint8_t, N > & | data | ) |
std::string esphome::format_hex | ( | const std::vector< uint8_t > & | data | ) |
Format the vector data
in lowercased hex.
Definition at line 258 of file helpers.cpp.
std::string esphome::format_hex | ( | const uint8_t * | data, |
size_t | length ) |
Format the byte array data
of length len
in lowercased hex.
Definition at line 249 of file helpers.cpp.
std::string esphome::format_hex | ( | T | val | ) |
std::string esphome::format_hex_pretty | ( | const std::string & | data, |
char | separator = '.', | ||
bool | show_length = true ) |
Format a string's bytes in pretty-printed, human-readable hex format.
Treats each character in the string as a byte and formats it in hex. Useful for debugging binary data stored in std::string containers.
data | String whose bytes should be formatted as hex. |
separator | Character to use between hex bytes (default: '.'). |
show_length | Whether to append the byte count in parentheses (default: true). |
Example:
Definition at line 308 of file helpers.cpp.
std::string esphome::format_hex_pretty | ( | const std::vector< uint16_t > & | data, |
char | separator = '.', | ||
bool | show_length = true ) |
Format a 16-bit word vector in pretty-printed, human-readable hex format.
Convenience overload for std::vector<uint16_t>. Each 16-bit word is formatted as a 4-digit uppercase hex value in big-endian order.
data | Vector of 16-bit words to format. |
separator | Character to use between hex words (default: '.'). |
show_length | Whether to append the word count in parentheses (default: true). |
Example:
Definition at line 305 of file helpers.cpp.
std::string esphome::format_hex_pretty | ( | const std::vector< uint8_t > & | data, |
char | separator = '.', | ||
bool | show_length = true ) |
Format a byte vector in pretty-printed, human-readable hex format.
Convenience overload for std::vector<uint8_t>. Formats each byte as a two-digit uppercase hex value with customizable separator.
data | Vector of bytes to format. |
separator | Character to use between hex bytes (default: '.'). |
show_length | Whether to append the byte count in parentheses (default: true). |
Example:
Definition at line 283 of file helpers.cpp.
std::string esphome::format_hex_pretty | ( | const uint16_t * | data, |
size_t | length, | ||
char | separator = '.', | ||
bool | show_length = true ) |
Format a 16-bit word array in pretty-printed, human-readable hex format.
Similar to the byte array version, but formats 16-bit words as 4-digit hex values.
data | Pointer to the 16-bit word array to format. |
length | Number of 16-bit words in the array. |
separator | Character to use between hex words (default: '.'). |
show_length | Whether to append the word count in parentheses (default: true). |
Example:
Definition at line 287 of file helpers.cpp.
std::string esphome::format_hex_pretty | ( | const uint8_t * | data, |
size_t | length, | ||
char | separator = '.', | ||
bool | show_length = true ) |
Format a byte array in pretty-printed, human-readable hex format.
Converts binary data to a hexadecimal string representation with customizable formatting. Each byte is displayed as a two-digit uppercase hex value, separated by the specified separator. Optionally includes the total byte count in parentheses at the end.
data | Pointer to the byte array to format. |
length | Number of bytes in the array. |
separator | Character to use between hex bytes (default: '.'). |
show_length | Whether to append the byte count in parentheses (default: true). |
Example:
Definition at line 280 of file helpers.cpp.
std::string esphome::format_hex_pretty | ( | T | val, |
char | separator = '.', | ||
bool | show_length = true ) |
Format an unsigned integer in pretty-printed, human-readable hex format.
Converts the integer to big-endian byte order and formats each byte as hex. The most significant byte appears first in the output string.
T | Unsigned integer type (uint8_t, uint16_t, uint32_t, uint64_t, etc.). |
val | The unsigned integer value to format. |
separator | Character to use between hex bytes (default: '.'). |
show_length | Whether to append the byte count in parentheses (default: true). |
Example:
std::string esphome::format_mac_address_pretty | ( | const uint8_t * | mac | ) |
Definition at line 244 of file helpers.cpp.
std::string esphome::format_mac_address_pretty | ( | const uint8_t | mac[6] | ) |
Format the six-byte array mac
into a MAC address.
float esphome::gamma_correct | ( | float | value, |
float | gamma ) |
Applies gamma correction of gamma
to value
.
Definition at line 482 of file helpers.cpp.
float esphome::gamma_uncorrect | ( | float | value, |
float | gamma ) |
Reverts gamma correction of gamma
to value
.
Definition at line 490 of file helpers.cpp.
std::string esphome::get_mac_address | ( | ) |
Get the device MAC address as a string, in lowercase hex notation.
Definition at line 578 of file helpers.cpp.
std::string esphome::get_mac_address_pretty | ( | ) |
Get the device MAC address as a string, in colon-separated uppercase hex notation.
Definition at line 584 of file helpers.cpp.
void esphome::get_mac_address_raw | ( | uint8_t * | mac | ) |
Get the device MAC address as raw bytes, written into the provided byte array (6 bytes).
Definition at line 73 of file helpers.cpp.
bool esphome::has_custom_mac_address | ( | ) |
Check if a custom MAC address is set (ESP32 & variants)
Definition at line 93 of file helpers.cpp.
void esphome::hsv_to_rgb | ( | int | hue, |
float | saturation, | ||
float | value, | ||
float & | red, | ||
float & | green, | ||
float & | blue ) |
Convert hue
(0-360), saturation
(0-1) and value
(0-1) to red
, green
and blue
(all 0-1).
Definition at line 522 of file helpers.cpp.
T & esphome::id | ( | T * | value | ) |
T esphome::id | ( | T | value | ) |
bool esphome::increment_time_value | ( | T & | current, |
uint16_t | begin, | ||
uint16_t | end ) |
|
inlinedelete |
bool esphome::mac_address_is_valid | ( | const uint8_t * | mac | ) |
Check if the MAC address is not all zeros or all ones.
Definition at line 594 of file helpers.cpp.
|
inline |
Definition at line 218 of file optional.h.
bool esphome::mqtt_is_connected | ( | ) |
const nullopt_t esphome::nullopt | ( | (nullopt_t::init()) | ) |
|
inline |
Definition at line 108 of file string_ref.h.
|
inline |
Definition at line 104 of file string_ref.h.
|
inline |
Definition at line 106 of file string_ref.h.
|
inline |
Definition at line 102 of file string_ref.h.
Definition at line 100 of file string_ref.h.
Definition at line 144 of file optional.h.
Definition at line 142 of file optional.h.
|
inline |
Definition at line 122 of file optional.h.
|
inline |
Definition at line 172 of file optional.h.
|
inline |
Definition at line 176 of file optional.h.
|
inline |
Definition at line 119 of file string_ref.h.
|
inline |
Definition at line 125 of file string_ref.h.
|
inline |
Definition at line 114 of file string_ref.h.
Definition at line 110 of file string_ref.h.
Definition at line 148 of file optional.h.
Definition at line 146 of file optional.h.
|
inline |
Definition at line 126 of file optional.h.
|
inline |
Definition at line 180 of file optional.h.
|
inline |
Definition at line 184 of file optional.h.
Definition at line 152 of file optional.h.
Definition at line 150 of file optional.h.
|
inline |
Definition at line 132 of file optional.h.
|
inline |
Definition at line 188 of file optional.h.
|
inline |
Definition at line 192 of file optional.h.
|
inline |
Definition at line 98 of file string_ref.h.
|
inline |
Definition at line 92 of file string_ref.h.
|
inline |
Definition at line 94 of file string_ref.h.
|
inline |
Definition at line 88 of file string_ref.h.
Definition at line 84 of file string_ref.h.
Definition at line 140 of file optional.h.
Definition at line 138 of file optional.h.
|
inline |
Definition at line 118 of file optional.h.
|
inline |
Definition at line 164 of file optional.h.
|
inline |
Definition at line 168 of file optional.h.
Definition at line 156 of file optional.h.
Definition at line 154 of file optional.h.
|
inline |
Definition at line 130 of file optional.h.
|
inline |
Definition at line 196 of file optional.h.
|
inline |
Definition at line 200 of file optional.h.
Definition at line 160 of file optional.h.
Definition at line 158 of file optional.h.
|
inline |
Definition at line 134 of file optional.h.
|
inline |
Definition at line 204 of file optional.h.
|
inline |
Definition at line 208 of file optional.h.
optional< T > esphome::parse_hex | ( | const char * | str | ) |
optional< T > esphome::parse_hex | ( | const char * | str, |
size_t | len ) |
size_t esphome::parse_hex | ( | const char * | str, |
size_t | len, | ||
uint8_t * | data, | ||
size_t | count ) |
Parse bytes from a hex-encoded string into a byte array.
When len
is less than 2*count
, the result is written to the back of data
(i.e. this function treats str
as if it were padded with zeros at the front).
str | String to read from. |
len | Length of str (excluding optional null-terminator), is a limit on the number of characters parsed. |
data | Byte array to write to. |
count | Length of data . |
str
. Definition at line 226 of file helpers.cpp.
|
inline |
|
inline |
optional< T > esphome::parse_hex | ( | const std::string & | str | ) |
|
inline |
|
inline |
optional< T > esphome::parse_number | ( | const char * | str | ) |
optional< T > esphome::parse_number | ( | const std::string & | str | ) |
ParseOnOffState esphome::parse_on_off | ( | const char * | str, |
const char * | on, | ||
const char * | off ) |
Parse a string that contains either on, off or toggle.
Definition at line 324 of file helpers.cpp.
bool esphome::random_bytes | ( | uint8_t * | data, |
size_t | len ) |
Generate len
number of random bytes.
Definition at line 18 of file helpers.cpp.
float esphome::random_float | ( | ) |
Return a random float between 0 and 1.
Definition at line 143 of file helpers.cpp.
uint32_t esphome::random_uint32 | ( | ) |
Return a random 32-bit unsigned integer.
Definition at line 17 of file helpers.cpp.
T esphome::remap | ( | U | value, |
U | min, | ||
U | max, | ||
T | min_out, | ||
T | max_out ) |
bool esphome::remote_is_connected | ( | ) |
void esphome::retry_handler | ( | const std::shared_ptr< RetryArgs > & | args | ) |
Definition at line 195 of file scheduler.cpp.
|
inline |
|
inline |
|
inline |
void esphome::rgb_to_hsv | ( | float | red, |
float | green, | ||
float | blue, | ||
int & | hue, | ||
float & | saturation, | ||
float & | value ) |
Convert red
, green
and blue
(all 0-1) values to hue
(0-360), saturation
(0-1) and value
(0-1).
Definition at line 499 of file helpers.cpp.
void esphome::set_mac_address | ( | uint8_t * | mac | ) |
Set the MAC address to use from the provided byte array (6 bytes).
Definition at line 91 of file helpers.cpp.
int8_t esphome::step_to_accuracy_decimals | ( | float | step | ) |
Derive accuracy in decimals from an increment step.
Definition at line 350 of file helpers.cpp.
std::string esphome::str_ctype_transform | ( | const std::string & | str | ) |
Definition at line 169 of file helpers.cpp.
bool esphome::str_endswith | ( | const std::string & | str, |
const std::string & | end ) |
Check whether a string ends with a value.
Definition at line 152 of file helpers.cpp.
bool esphome::str_equals_case_insensitive | ( | const std::string & | a, |
const std::string & | b ) |
Compare strings for equality in case-insensitive manner.
Definition at line 147 of file helpers.cpp.
std::string esphome::str_lower_case | ( | const std::string & | str | ) |
Convert the string to lower case.
Definition at line 175 of file helpers.cpp.
std::string esphome::str_sanitize | ( | const std::string & | str | ) |
Sanitizes the input string by removing all characters but alphanumerics, dashes and underscores.
Definition at line 184 of file helpers.cpp.
std::string esphome::str_snake_case | ( | const std::string & | str | ) |
Convert the string to snake case (lowercase with underscores).
Definition at line 177 of file helpers.cpp.
std::string esphome::str_snprintf | ( | const char * | fmt, |
size_t | len, | ||
... ) |
Definition at line 194 of file helpers.cpp.
std::string esphome::str_sprintf | ( | const char * | fmt, |
... ) |
Definition at line 208 of file helpers.cpp.
bool esphome::str_startswith | ( | const std::string & | str, |
const std::string & | start ) |
Check whether a string starts with a value.
Definition at line 151 of file helpers.cpp.
std::string esphome::str_truncate | ( | const std::string & | str, |
size_t | length ) |
Truncate a string to a specific length.
Definition at line 159 of file helpers.cpp.
std::string esphome::str_until | ( | const char * | str, |
char | ch ) |
Extract the part of the string until either the first occurrence of the specified character, or the end (requires str to be null-terminated).
Definition at line 162 of file helpers.cpp.
std::string esphome::str_until | ( | const std::string & | str, |
char | ch ) |
Extract the part of the string until either the first occurrence of the specified character, or the end.
Definition at line 166 of file helpers.cpp.
std::string esphome::str_upper_case | ( | const std::string & | str | ) |
Convert the string to upper case.
Definition at line 176 of file helpers.cpp.
Definition at line 214 of file optional.h.
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 339 of file helpers.cpp.
Application esphome::App |
Global storage of Application pointer - only one Application can exist.
Definition at line 587 of file application.cpp.
const uint8_t esphome::COMPONENT_STATE_CONSTRUCTION = 0x00 |
Definition at line 65 of file component.cpp.
const uint8_t esphome::COMPONENT_STATE_FAILED = 0x03 |
Definition at line 68 of file component.cpp.
const uint8_t esphome::COMPONENT_STATE_LOOP = 0x02 |
Definition at line 67 of file component.cpp.
const uint8_t esphome::COMPONENT_STATE_LOOP_DONE = 0x04 |
Definition at line 69 of file component.cpp.
const uint8_t esphome::COMPONENT_STATE_MASK = 0x07 |
Definition at line 64 of file component.cpp.
const uint8_t esphome::COMPONENT_STATE_SETUP = 0x01 |
Definition at line 66 of file component.cpp.
ESPPreferences * esphome::global_preferences |
Definition at line 195 of file preferences.cpp.
runtime_stats::RuntimeStatsCollector * esphome::global_runtime_stats |
Definition at line 97 of file runtime_stats.cpp.
uint32_t esphome::global_state = 0 |
Definition at line 79 of file component.cpp.
const uint8_t esphome::STATUS_LED_ERROR = 0x10 |
Definition at line 74 of file component.cpp.
const uint8_t esphome::STATUS_LED_MASK = 0x18 |
Definition at line 71 of file component.cpp.
const uint8_t esphome::STATUS_LED_OK = 0x00 |
Definition at line 72 of file component.cpp.
const uint8_t esphome::STATUS_LED_WARNING = 0x08 |
Definition at line 73 of file component.cpp.
const uint16_t esphome::WARN_IF_BLOCKING_INCREMENT_MS = 10U |
How long the blocking time must be larger to warn again.
Definition at line 77 of file component.cpp.
const uint16_t esphome::WARN_IF_BLOCKING_OVER_MS = 50U |
Initial blocking time allowed without warning.
Definition at line 76 of file component.cpp.