ESPHome  2024.10.2
defines.h
Go to the documentation of this file.
1 #pragma once
2 
3 // This file is not used by the runtime, instead, a version is generated during
4 // compilation with only the relevant feature flags for the current build.
5 //
6 // This file is only used by static analyzers and IDEs.
7 
8 #include "esphome/core/macros.h"
9 
10 // Informative flags
11 #define ESPHOME_BOARD "dummy_board"
12 #define ESPHOME_PROJECT_NAME "dummy project"
13 #define ESPHOME_PROJECT_VERSION "v2"
14 #define ESPHOME_PROJECT_VERSION_30 "v2"
15 #define ESPHOME_VARIANT "ESP32"
16 
17 // Feature flags
18 #define USE_ALARM_CONTROL_PANEL
19 #define USE_API
20 #define USE_API_NOISE
21 #define USE_API_PLAINTEXT
22 #define USE_BINARY_SENSOR
23 #define USE_BUTTON
24 #define USE_CLIMATE
25 #define USE_COVER
26 #define USE_DATETIME
27 #define USE_DATETIME_DATE
28 #define USE_DATETIME_DATETIME
29 #define USE_DATETIME_TIME
30 #define USE_DEEP_SLEEP
31 #define USE_DISPLAY
32 #define USE_ESP32_IMPROV_STATE_CALLBACK
33 #define USE_EVENT
34 #define USE_FAN
35 #define USE_GRAPH
36 #define USE_GRAPHICAL_DISPLAY_MENU
37 #define USE_HOMEASSISTANT_TIME
38 #define USE_HTTP_REQUEST_OTA_WATCHDOG_TIMEOUT 8000 // NOLINT
39 #define USE_JSON
40 #define USE_LIGHT
41 #define USE_LOCK
42 #define USE_LOGGER
43 #define USE_LVGL
44 #define USE_LVGL_ANIMIMG
45 #define USE_LVGL_BINARY_SENSOR
46 #define USE_LVGL_BUTTONMATRIX
47 #define USE_LVGL_FONT
48 #define USE_LVGL_IMAGE
49 #define USE_LVGL_KEY_LISTENER
50 #define USE_LVGL_KEYBOARD
51 #define USE_LVGL_ROTARY_ENCODER
52 #define USE_LVGL_TOUCHSCREEN
53 #define USE_MD5
54 #define USE_MDNS
55 #define USE_MEDIA_PLAYER
56 #define USE_MQTT
57 #define USE_NETWORK
58 #define USE_NEXTION_TFT_UPLOAD
59 #define USE_NUMBER
60 #define USE_ONLINE_IMAGE_PNG_SUPPORT
61 #define USE_OTA
62 #define USE_OTA_PASSWORD
63 #define USE_OTA_STATE_CALLBACK
64 #define USE_OTA_VERSION 1
65 #define USE_OUTPUT
66 #define USE_POWER_SUPPLY
67 #define USE_QR_CODE
68 #define USE_SELECT
69 #define USE_SENSOR
70 #define USE_STATUS_LED
71 #define USE_SWITCH
72 #define USE_TEXT
73 #define USE_TEXT_SENSOR
74 #define USE_TIME
75 #define USE_TOUCHSCREEN
76 #define USE_UART_DEBUGGER
77 #define USE_UPDATE
78 #define USE_VALVE
79 #define USE_WIFI
80 #define USE_WIFI_AP
81 #define USE_WIREGUARD
82 
83 // Arduino-specific feature flags
84 #ifdef USE_ARDUINO
85 #define USE_CAPTIVE_PORTAL
86 #define USE_PROMETHEUS
87 #define USE_WEBSERVER
88 #define USE_WEBSERVER_PORT 80 // NOLINT
89 #define USE_WIFI_WPA2_EAP
90 #endif
91 
92 // IDF-specific feature flags
93 #ifdef USE_ESP_IDF
94 #define USE_MQTT_IDF_ENQUEUE
95 #endif
96 
97 // ESP32-specific feature flags
98 #ifdef USE_ESP32
99 #define USE_BLUETOOTH_PROXY
100 #define USE_ESP32_BLE
101 #define USE_ESP32_BLE_CLIENT
102 #define USE_ESP32_BLE_SERVER
103 #define USE_ESP32_CAMERA
104 #define USE_IMPROV
105 #define USE_MICRO_WAKE_WORD_VAD
106 #define USE_MICROPHONE
107 #define USE_PSRAM
108 #define USE_SOCKET_IMPL_BSD_SOCKETS
109 #define USE_SPEAKER
110 #define USE_SPI
111 #define USE_VOICE_ASSISTANT
112 #define USE_WIFI_11KV_SUPPORT
113 
114 #ifdef USE_ARDUINO
115 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(2, 0, 5)
116 #define USE_ETHERNET
117 #endif
118 
119 #ifdef USE_ESP_IDF
120 #define USE_ESP_IDF_VERSION_CODE VERSION_CODE(4, 4, 2)
121 #endif
122 
123 #if defined(USE_ESP32_VARIANT_ESP32S2)
124 #define USE_LOGGER_USB_CDC
125 #elif defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32C3) || \
126  defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32H2)
127 #define USE_LOGGER_USB_CDC
128 #define USE_LOGGER_USB_SERIAL_JTAG
129 #endif
130 #endif
131 
132 // ESP8266-specific feature flags
133 #ifdef USE_ESP8266
134 #define USE_ADC_SENSOR_VCC
135 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 1, 2)
136 #define USE_ESP8266_PREFERENCES_FLASH
137 #define USE_HTTP_REQUEST_ESP8266_HTTPS
138 #define USE_SOCKET_IMPL_LWIP_TCP
139 
140 #define USE_SPI
141 
142 // Dummy firmware payload for shelly_dimmer
143 #define USE_SHD_FIRMWARE_MAJOR_VERSION 56
144 #define USE_SHD_FIRMWARE_MINOR_VERSION 5
145 #define USE_SHD_FIRMWARE_DATA \
146  {}
147 
148 #endif
149 
150 #ifdef USE_RP2040
151 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 3, 0)
152 #define USE_LOGGER_USB_CDC
153 #define USE_SOCKET_IMPL_LWIP_TCP
154 #define USE_SPI
155 #endif
156 
157 #ifdef USE_LIBRETINY
158 #define USE_SOCKET_IMPL_LWIP_SOCKETS
159 #endif
160 
161 #ifdef USE_HOST
162 #define USE_SOCKET_IMPL_BSD_SOCKETS
163 #endif
164 
165 // Disabled feature flags
166 // #define USE_BSEC // Requires a library with proprietary license
167 // #define USE_BSEC2 // Requires a library with proprietary license
168 
169 #define USE_DASHBOARD_IMPORT