ESPHome  2024.2.0
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_VARIANT "ESP32"
15 
16 // Feature flags
17 #define USE_API
18 #define USE_API_NOISE
19 #define USE_API_PLAINTEXT
20 #define USE_ALARM_CONTROL_PANEL
21 #define USE_BINARY_SENSOR
22 #define USE_BUTTON
23 #define USE_CLIMATE
24 #define USE_COVER
25 #define USE_DEEP_SLEEP
26 #define USE_FAN
27 #define USE_GRAPH
28 #define USE_HOMEASSISTANT_TIME
29 #define USE_JSON
30 #define USE_LIGHT
31 #define USE_LOCK
32 #define USE_LOGGER
33 #define USE_MDNS
34 #define USE_MEDIA_PLAYER
35 #define USE_MQTT
36 #define USE_NUMBER
37 #define USE_OTA
38 #define USE_OTA_PASSWORD
39 #define USE_OTA_STATE_CALLBACK
40 #define USE_OTA_VERSION 1
41 #define USE_OUTPUT
42 #define USE_POWER_SUPPLY
43 #define USE_QR_CODE
44 #define USE_SELECT
45 #define USE_SENSOR
46 #define USE_STATUS_LED
47 #define USE_SWITCH
48 #define USE_TEXT
49 #define USE_TEXT_SENSOR
50 #define USE_TIME
51 #define USE_TOUCHSCREEN
52 #define USE_UART_DEBUGGER
53 #define USE_WIFI
54 #define USE_WIFI_AP
55 #define USE_GRAPHICAL_DISPLAY_MENU
56 
57 // Arduino-specific feature flags
58 #ifdef USE_ARDUINO
59 #define USE_CAPTIVE_PORTAL
60 #define USE_NEXTION_TFT_UPLOAD
61 #define USE_PROMETHEUS
62 #define USE_WEBSERVER
63 #define USE_WEBSERVER_PORT 80 // NOLINT
64 #define USE_WIFI_WPA2_EAP
65 #endif
66 
67 // IDF-specific feature flags
68 #ifdef USE_ESP_IDF
69 #define USE_MQTT_IDF_ENQUEUE
70 #endif
71 
72 // ESP32-specific feature flags
73 #ifdef USE_ESP32
74 #define USE_ESP32_BLE_CLIENT
75 #define USE_ESP32_BLE_SERVER
76 #define USE_ESP32_CAMERA
77 #define USE_IMPROV
78 #define USE_SOCKET_IMPL_BSD_SOCKETS
79 #define USE_WIFI_11KV_SUPPORT
80 #define USE_BLUETOOTH_PROXY
81 #define USE_VOICE_ASSISTANT
82 #define USE_MICROPHONE
83 #define USE_SPEAKER
84 #define USE_SPI
85 
86 #ifdef USE_ARDUINO
87 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(2, 0, 5)
88 #define USE_ETHERNET
89 #endif
90 
91 #ifdef USE_ESP_IDF
92 #define USE_ESP_IDF_VERSION_CODE VERSION_CODE(4, 4, 2)
93 #endif
94 #endif
95 
96 // ESP8266-specific feature flags
97 #ifdef USE_ESP8266
98 #define USE_ADC_SENSOR_VCC
99 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 0, 2)
100 #define USE_ESP8266_PREFERENCES_FLASH
101 #define USE_HTTP_REQUEST_ESP8266_HTTPS
102 #define USE_SOCKET_IMPL_LWIP_TCP
103 
104 #define USE_SPI
105 
106 // Dummy firmware payload for shelly_dimmer
107 #define USE_SHD_FIRMWARE_MAJOR_VERSION 56
108 #define USE_SHD_FIRMWARE_MINOR_VERSION 5
109 #define USE_SHD_FIRMWARE_DATA \
110  {}
111 
112 #endif
113 
114 #ifdef USE_RP2040
115 #define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 3, 0)
116 #define USE_SOCKET_IMPL_LWIP_TCP
117 #define USE_SPI
118 #endif
119 
120 #ifdef USE_LIBRETINY
121 #define USE_SOCKET_IMPL_LWIP_SOCKETS
122 #endif
123 
124 #ifdef USE_HOST
125 #define USE_SOCKET_IMPL_BSD_SOCKETS
126 #endif
127 
128 // Disabled feature flags
129 // #define USE_BSEC // Requires a library with proprietary license.
130 
131 #define USE_DASHBOARD_IMPORT