ESPHome  2024.11.1
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_DROPDOWN
48 #define USE_LVGL_FONT
49 #define USE_LVGL_IMAGE
50 #define USE_LVGL_KEY_LISTENER
51 #define USE_LVGL_KEYBOARD
52 #define USE_LVGL_ROLLER
53 #define USE_LVGL_ROTARY_ENCODER
54 #define USE_LVGL_TOUCHSCREEN
55 #define USE_MD5
56 #define USE_MDNS
57 #define USE_MEDIA_PLAYER
58 #define USE_MQTT
59 #define USE_NETWORK
60 #define USE_NEXTION_TFT_UPLOAD
61 #define USE_NUMBER
62 #define USE_ONLINE_IMAGE_PNG_SUPPORT
63 #define USE_OTA
64 #define USE_OTA_PASSWORD
65 #define USE_OTA_STATE_CALLBACK
66 #define USE_OTA_VERSION 1
67 #define USE_OUTPUT
68 #define USE_POWER_SUPPLY
69 #define USE_QR_CODE
70 #define USE_SELECT
71 #define USE_SENSOR
72 #define USE_STATUS_LED
73 #define USE_SWITCH
74 #define USE_TEXT
75 #define USE_TEXT_SENSOR
76 #define USE_TIME
77 #define USE_TOUCHSCREEN
78 #define USE_UART_DEBUGGER
79 #define USE_UPDATE
80 #define USE_VALVE
81 #define USE_WIFI
82 #define USE_WIFI_AP
83 #define USE_WIREGUARD
84 
85 // Arduino-specific feature flags
86 #ifdef USE_ARDUINO
87 #define USE_CAPTIVE_PORTAL
88 #define USE_PROMETHEUS
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_WEBSERVER
113 #define USE_WEBSERVER_PORT 80 // NOLINT
114 #define USE_WIFI_11KV_SUPPORT
115 
116 #ifdef USE_ARDUINO
117 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(2, 0, 5)
118 #define USE_ETHERNET
119 #endif
120 
121 #ifdef USE_ESP_IDF
122 #define USE_ESP_IDF_VERSION_CODE VERSION_CODE(4, 4, 2)
123 #endif
124 
125 #if defined(USE_ESP32_VARIANT_ESP32S2)
126 #define USE_LOGGER_USB_CDC
127 #elif defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32C3) || \
128  defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32H2)
129 #define USE_LOGGER_USB_CDC
130 #define USE_LOGGER_USB_SERIAL_JTAG
131 #endif
132 #endif
133 
134 // ESP8266-specific feature flags
135 #ifdef USE_ESP8266
136 #define USE_ADC_SENSOR_VCC
137 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 1, 2)
138 #define USE_ESP8266_PREFERENCES_FLASH
139 #define USE_HTTP_REQUEST_ESP8266_HTTPS
140 #define USE_SOCKET_IMPL_LWIP_TCP
141 
142 #define USE_SPI
143 
144 // Dummy firmware payload for shelly_dimmer
145 #define USE_SHD_FIRMWARE_MAJOR_VERSION 56
146 #define USE_SHD_FIRMWARE_MINOR_VERSION 5
147 #define USE_SHD_FIRMWARE_DATA \
148  {}
149 
150 #define USE_WEBSERVER
151 #define USE_WEBSERVER_PORT 80 // NOLINT
152 #endif
153 
154 #ifdef USE_RP2040
155 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 3, 0)
156 #define USE_LOGGER_USB_CDC
157 #define USE_SOCKET_IMPL_LWIP_TCP
158 #define USE_SPI
159 #endif
160 
161 #ifdef USE_LIBRETINY
162 #define USE_SOCKET_IMPL_LWIP_SOCKETS
163 #define USE_WEBSERVER
164 #define USE_WEBSERVER_PORT 80 // NOLINT
165 #endif
166 
167 #ifdef USE_HOST
168 #define USE_SOCKET_IMPL_BSD_SOCKETS
169 #endif
170 
171 // Disabled feature flags
172 // #define USE_BSEC // Requires a library with proprietary license
173 // #define USE_BSEC2 // Requires a library with proprietary license
174 
175 #define USE_DASHBOARD_IMPORT