esphome 2024.9.1__py3-none-any.whl → 2024.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. esphome/components/aic3204/__init__.py +0 -0
  2. esphome/components/aic3204/aic3204.cpp +173 -0
  3. esphome/components/aic3204/aic3204.h +88 -0
  4. esphome/components/aic3204/audio_dac.py +52 -0
  5. esphome/components/aic3204/automation.h +23 -0
  6. esphome/components/alarm_control_panel/__init__.py +3 -4
  7. esphome/components/animation/__init__.py +16 -12
  8. esphome/components/api/api_connection.cpp +2 -0
  9. esphome/components/api/api_connection.h +3 -1
  10. esphome/components/api/api_frame_helper.cpp +2 -1
  11. esphome/components/api/api_frame_helper.h +2 -1
  12. esphome/components/api/api_server.cpp +2 -0
  13. esphome/components/api/api_server.h +3 -1
  14. esphome/components/api/custom_api_device.h +3 -2
  15. esphome/components/api/homeassistant_service.h +4 -3
  16. esphome/components/api/list_entities.cpp +2 -0
  17. esphome/components/api/list_entities.h +3 -2
  18. esphome/components/api/subscribe_state.cpp +2 -0
  19. esphome/components/api/subscribe_state.h +3 -2
  20. esphome/components/audio_dac/__init__.py +57 -0
  21. esphome/components/audio_dac/audio_dac.h +23 -0
  22. esphome/components/audio_dac/automation.h +43 -0
  23. esphome/components/bang_bang/bang_bang_climate.cpp +5 -2
  24. esphome/components/bedjet/bedjet_codec.cpp +4 -2
  25. esphome/components/binary_sensor/__init__.py +3 -4
  26. esphome/components/bl0906/sensor.py +3 -2
  27. esphome/components/button/__init__.py +3 -4
  28. esphome/components/ch422g/__init__.py +26 -17
  29. esphome/components/ch422g/ch422g.cpp +66 -49
  30. esphome/components/ch422g/ch422g.h +17 -19
  31. esphome/components/climate/__init__.py +3 -4
  32. esphome/components/cover/__init__.py +4 -5
  33. esphome/components/cse7766/cse7766.cpp +12 -1
  34. esphome/components/cse7766/cse7766.h +4 -0
  35. esphome/components/cse7766/sensor.py +13 -1
  36. esphome/components/cst816/touchscreen/__init__.py +7 -4
  37. esphome/components/cst816/touchscreen/cst816_touchscreen.cpp +20 -19
  38. esphome/components/cst816/touchscreen/cst816_touchscreen.h +2 -0
  39. esphome/components/datetime/__init__.py +21 -14
  40. esphome/components/datetime/datetime_base.h +8 -1
  41. esphome/components/datetime/datetime_entity.cpp +2 -0
  42. esphome/components/datetime/datetime_entity.h +2 -0
  43. esphome/components/datetime/time_entity.cpp +2 -0
  44. esphome/components/datetime/time_entity.h +2 -0
  45. esphome/components/esp32/__init__.py +20 -4
  46. esphome/components/esp32_improv/__init__.py +82 -1
  47. esphome/components/esp32_improv/automation.h +72 -0
  48. esphome/components/esp32_improv/esp32_improv_component.cpp +13 -5
  49. esphome/components/esp32_improv/esp32_improv_component.h +15 -0
  50. esphome/components/ethernet/__init__.py +5 -0
  51. esphome/components/ethernet/ethernet_component.cpp +13 -0
  52. esphome/components/ethernet/ethernet_component.h +1 -0
  53. esphome/components/event/__init__.py +20 -12
  54. esphome/components/fan/__init__.py +3 -4
  55. esphome/components/gp2y1010au0f/__init__.py +0 -0
  56. esphome/components/gp2y1010au0f/gp2y1010au0f.cpp +67 -0
  57. esphome/components/gp2y1010au0f/gp2y1010au0f.h +52 -0
  58. esphome/components/gp2y1010au0f/sensor.py +61 -0
  59. esphome/components/gpio_expander/__init__.py +0 -0
  60. esphome/components/gpio_expander/cached_gpio.h +38 -0
  61. esphome/components/grove_gas_mc_v2/__init__.py +0 -0
  62. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +88 -0
  63. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.h +39 -0
  64. esphome/components/grove_gas_mc_v2/sensor.py +77 -0
  65. esphome/components/haier/climate.py +4 -3
  66. esphome/components/haier/haier_base.cpp +63 -8
  67. esphome/components/haier/haier_base.h +29 -3
  68. esphome/components/haier/hon_climate.cpp +122 -65
  69. esphome/components/haier/hon_climate.h +18 -2
  70. esphome/components/haier/smartair2_climate.cpp +21 -21
  71. esphome/components/haier/switch/__init__.py +91 -0
  72. esphome/components/haier/switch/beeper.cpp +14 -0
  73. esphome/components/haier/switch/beeper.h +18 -0
  74. esphome/components/haier/switch/display.cpp +14 -0
  75. esphome/components/haier/switch/display.h +18 -0
  76. esphome/components/haier/switch/health_mode.cpp +14 -0
  77. esphome/components/haier/switch/health_mode.h +18 -0
  78. esphome/components/haier/switch/quiet_mode.cpp +14 -0
  79. esphome/components/haier/switch/quiet_mode.h +18 -0
  80. esphome/components/hmac_md5/hmac_md5.cpp +2 -0
  81. esphome/components/hmac_md5/hmac_md5.h +2 -1
  82. esphome/components/i2s_audio/speaker/__init__.py +19 -0
  83. esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +1 -1
  84. esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +2 -0
  85. esphome/components/ili9xxx/ili9xxx_display.h +1 -0
  86. esphome/components/image/__init__.py +12 -12
  87. esphome/components/image/image.cpp +44 -0
  88. esphome/components/image/image.h +17 -2
  89. esphome/components/inkplate6/display.py +2 -0
  90. esphome/components/inkplate6/inkplate.h +30 -2
  91. esphome/components/light/__init__.py +3 -4
  92. esphome/components/lock/__init__.py +3 -4
  93. esphome/components/lvgl/__init__.py +16 -5
  94. esphome/components/lvgl/defines.py +1 -0
  95. esphome/components/lvgl/hello_world.py +64 -0
  96. esphome/components/lvgl/lv_validation.py +159 -3
  97. esphome/components/lvgl/lvgl_esphome.cpp +0 -43
  98. esphome/components/lvgl/lvgl_esphome.h +0 -4
  99. esphome/components/lvgl/styles.py +3 -2
  100. esphome/components/lvgl/text/__init__.py +3 -3
  101. esphome/components/lvgl/widgets/__init__.py +2 -0
  102. esphome/components/lvgl/widgets/animimg.py +3 -4
  103. esphome/components/lvgl/widgets/dropdown.py +5 -1
  104. esphome/components/lvgl/widgets/meter.py +16 -11
  105. esphome/components/md5/__init__.py +6 -0
  106. esphome/components/md5/md5.cpp +2 -0
  107. esphome/components/md5/md5.h +2 -0
  108. esphome/components/micro_wake_word/__init__.py +7 -0
  109. esphome/components/mics_4514/sensor.py +11 -26
  110. esphome/components/modbus_controller/__init__.py +7 -5
  111. esphome/components/modbus_controller/binary_sensor/__init__.py +6 -6
  112. esphome/components/modbus_controller/number/__init__.py +5 -6
  113. esphome/components/modbus_controller/output/__init__.py +10 -14
  114. esphome/components/modbus_controller/select/__init__.py +1 -1
  115. esphome/components/modbus_controller/sensor/__init__.py +7 -7
  116. esphome/components/modbus_controller/switch/__init__.py +6 -7
  117. esphome/components/modbus_controller/text_sensor/__init__.py +8 -9
  118. esphome/components/mqtt/__init__.py +3 -0
  119. esphome/components/mqtt/mqtt_client.cpp +2 -0
  120. esphome/components/mqtt/mqtt_client.h +2 -0
  121. esphome/components/nau7802/__init__.py +0 -0
  122. esphome/components/nau7802/nau7802.cpp +323 -0
  123. esphome/components/nau7802/nau7802.h +121 -0
  124. esphome/components/nau7802/sensor.py +134 -0
  125. esphome/components/nextion/base_component.py +1 -0
  126. esphome/components/nextion/display.py +4 -0
  127. esphome/components/nextion/nextion.cpp +19 -4
  128. esphome/components/nextion/nextion.h +16 -0
  129. esphome/components/npi19/__init__.py +0 -0
  130. esphome/components/npi19/npi19.cpp +111 -0
  131. esphome/components/npi19/npi19.h +30 -0
  132. esphome/components/npi19/sensor.py +52 -0
  133. esphome/components/number/__init__.py +3 -5
  134. esphome/components/online_image/__init__.py +1 -1
  135. esphome/components/online_image/online_image.h +1 -2
  136. esphome/components/opentherm/__init__.py +57 -0
  137. esphome/components/opentherm/hub.cpp +277 -0
  138. esphome/components/opentherm/hub.h +110 -0
  139. esphome/components/opentherm/opentherm.cpp +568 -0
  140. esphome/components/opentherm/opentherm.h +347 -0
  141. esphome/components/pulse_counter/pulse_counter_sensor.cpp +8 -1
  142. esphome/components/pulse_counter/pulse_counter_sensor.h +1 -0
  143. esphome/components/radon_eye_ble/radon_eye_listener.cpp +10 -3
  144. esphome/components/remote_transmitter/__init__.py +18 -2
  145. esphome/components/remote_transmitter/remote_transmitter.h +6 -0
  146. esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +2 -0
  147. esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +2 -0
  148. esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +2 -0
  149. esphome/components/rp2040/__init__.py +13 -14
  150. esphome/components/select/__init__.py +3 -4
  151. esphome/components/sensor/__init__.py +3 -4
  152. esphome/components/shelly_dimmer/shelly_dimmer.cpp +32 -32
  153. esphome/components/shelly_dimmer/shelly_dimmer.h +2 -0
  154. esphome/components/st7701s/st7701s.cpp +21 -8
  155. esphome/components/st7701s/st7701s.h +2 -0
  156. esphome/components/switch/__init__.py +3 -4
  157. esphome/components/tca9555/__init__.py +72 -0
  158. esphome/components/tca9555/tca9555.cpp +140 -0
  159. esphome/components/tca9555/tca9555.h +64 -0
  160. esphome/components/tcs34725/tcs34725.cpp +62 -64
  161. esphome/components/tem3200/__init__.py +0 -0
  162. esphome/components/tem3200/sensor.py +55 -0
  163. esphome/components/tem3200/tem3200.cpp +151 -0
  164. esphome/components/tem3200/tem3200.h +30 -0
  165. esphome/components/template/binary_sensor/__init__.py +19 -6
  166. esphome/components/text/__init__.py +3 -4
  167. esphome/components/text_sensor/__init__.py +3 -4
  168. esphome/components/thermostat/climate.py +11 -9
  169. esphome/components/thermostat/thermostat_climate.cpp +21 -15
  170. esphome/components/tm1638/binary_sensor/__init__.py +3 -2
  171. esphome/components/tm1638/display.py +5 -5
  172. esphome/components/tm1638/output/__init__.py +3 -2
  173. esphome/components/tm1638/switch/__init__.py +3 -2
  174. esphome/components/touchscreen/touchscreen.cpp +2 -2
  175. esphome/components/update/__init__.py +3 -4
  176. esphome/components/valve/__init__.py +3 -4
  177. esphome/components/web_server/__init__.py +78 -22
  178. esphome/components/web_server/server_index_v3.h +3989 -3979
  179. esphome/components/web_server/web_server.cpp +219 -34
  180. esphome/components/web_server/web_server.h +10 -1
  181. esphome/components/wifi/wifi_component_esp_idf.cpp +4 -5
  182. esphome/config_validation.py +1 -0
  183. esphome/const.py +12 -2
  184. esphome/core/defines.h +4 -2
  185. esphome/core/helpers.cpp +46 -10
  186. esphome/core/helpers.h +8 -0
  187. esphome/core/ring_buffer.cpp +12 -2
  188. esphome/core/ring_buffer.h +3 -0
  189. esphome/voluptuous_schema.py +3 -1
  190. esphome/wizard.py +0 -3
  191. {esphome-2024.9.1.dist-info → esphome-2024.10.0.dist-info}/METADATA +5 -3
  192. {esphome-2024.9.1.dist-info → esphome-2024.10.0.dist-info}/RECORD +196 -147
  193. {esphome-2024.9.1.dist-info → esphome-2024.10.0.dist-info}/LICENSE +0 -0
  194. {esphome-2024.9.1.dist-info → esphome-2024.10.0.dist-info}/WHEEL +0 -0
  195. {esphome-2024.9.1.dist-info → esphome-2024.10.0.dist-info}/entry_points.txt +0 -0
  196. {esphome-2024.9.1.dist-info → esphome-2024.10.0.dist-info}/top_level.txt +0 -0
esphome/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants used by esphome."""
2
2
 
3
- __version__ = "2024.9.1"
3
+ __version__ = "2024.10.0"
4
4
 
5
5
  ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
6
6
  VALID_SUBSTITUTIONS_CHARACTERS = (
@@ -53,6 +53,7 @@ CONF_ALLOW_OTHER_USES = "allow_other_uses"
53
53
  CONF_ALPHA = "alpha"
54
54
  CONF_ALTITUDE = "altitude"
55
55
  CONF_AMBIENT_LIGHT = "ambient_light"
56
+ CONF_AMMONIA = "ammonia"
56
57
  CONF_ANALOG = "analog"
57
58
  CONF_AND = "and"
58
59
  CONF_ANGLE = "angle"
@@ -110,6 +111,7 @@ CONF_CALIBRATE_LINEAR = "calibrate_linear"
110
111
  CONF_CALIBRATION = "calibration"
111
112
  CONF_CAPACITANCE = "capacitance"
112
113
  CONF_CAPACITY = "capacity"
114
+ CONF_CARBON_MONOXIDE = "carbon_monoxide"
113
115
  CONF_CARRIER_DUTY_PERCENT = "carrier_duty_percent"
114
116
  CONF_CARRIER_FREQUENCY = "carrier_frequency"
115
117
  CONF_CERTIFICATE = "certificate"
@@ -120,6 +122,7 @@ CONF_CHANNELS = "channels"
120
122
  CONF_CHARACTERISTIC_UUID = "characteristic_uuid"
121
123
  CONF_CHECK = "check"
122
124
  CONF_CHIPSET = "chipset"
125
+ CONF_CLEAN_SESSION = "clean_session"
123
126
  CONF_CLEAR_IMPEDANCE = "clear_impedance"
124
127
  CONF_CLIENT_CERTIFICATE = "client_certificate"
125
128
  CONF_CLIENT_CERTIFICATE_KEY = "client_certificate_key"
@@ -262,6 +265,7 @@ CONF_ENUM_DATAPOINT = "enum_datapoint"
262
265
  CONF_EQUATION = "equation"
263
266
  CONF_ESP8266_DISABLE_SSL_SUPPORT = "esp8266_disable_ssl_support"
264
267
  CONF_ESPHOME = "esphome"
268
+ CONF_ETHANOL = "ethanol"
265
269
  CONF_ETHERNET = "ethernet"
266
270
  CONF_EVENT = "event"
267
271
  CONF_EVENT_TYPE = "event_type"
@@ -360,6 +364,7 @@ CONF_HOURS = "hours"
360
364
  CONF_HSYNC_PIN = "hsync_pin"
361
365
  CONF_HUMIDITY = "humidity"
362
366
  CONF_HUMIDITY_SENSOR = "humidity_sensor"
367
+ CONF_HYDROGEN = "hydrogen"
363
368
  CONF_HYSTERESIS = "hysteresis"
364
369
  CONF_I2C = "i2c"
365
370
  CONF_I2C_ID = "i2c_id"
@@ -375,6 +380,7 @@ CONF_IDLE_ACTION = "idle_action"
375
380
  CONF_IDLE_LEVEL = "idle_level"
376
381
  CONF_IDLE_TIME = "idle_time"
377
382
  CONF_IF = "if"
383
+ CONF_IGNORE_EFUSE_CUSTOM_MAC = "ignore_efuse_custom_mac"
378
384
  CONF_IGNORE_EFUSE_MAC_CRC = "ignore_efuse_mac_crc"
379
385
  CONF_IGNORE_OUT_OF_RANGE = "ignore_out_of_range"
380
386
  CONF_IGNORE_PIN_VALIDATION_ERROR = "ignore_pin_validation_error"
@@ -475,6 +481,7 @@ CONF_MEDIA_PLAYER = "media_player"
475
481
  CONF_MEDIUM = "medium"
476
482
  CONF_MEMORY_BLOCKS = "memory_blocks"
477
483
  CONF_MESSAGE = "message"
484
+ CONF_METHANE = "methane"
478
485
  CONF_METHOD = "method"
479
486
  CONF_MICROPHONE = "microphone"
480
487
  CONF_MIN_BRIGHTNESS = "min_brightness"
@@ -521,6 +528,7 @@ CONF_NBITS = "nbits"
521
528
  CONF_NEC = "nec"
522
529
  CONF_NETWORKS = "networks"
523
530
  CONF_NEW_PASSWORD = "new_password"
531
+ CONF_NITROGEN_DIOXIDE = "nitrogen_dioxide"
524
532
  CONF_NOISE_LEVEL = "noise_level"
525
533
  CONF_NUM_ATTEMPTS = "num_attempts"
526
534
  CONF_NUM_CHANNELS = "num_channels"
@@ -926,7 +934,6 @@ CONF_WARM_WHITE_COLOR_TEMPERATURE = "warm_white_color_temperature"
926
934
  CONF_WATCHDOG_THRESHOLD = "watchdog_threshold"
927
935
  CONF_WEB_SERVER = "web_server"
928
936
  CONF_WEB_SERVER_ID = "web_server_id"
929
- CONF_WEB_SERVER_SORTING_WEIGHT = "web_server_sorting_weight"
930
937
  CONF_WEIGHT = "weight"
931
938
  CONF_WHILE = "while"
932
939
  CONF_WHITE = "white"
@@ -954,6 +961,7 @@ ICON_ACCELERATION_Y = "mdi:axis-y-arrow"
954
961
  ICON_ACCELERATION_Z = "mdi:axis-z-arrow"
955
962
  ICON_ACCOUNT = "mdi:account"
956
963
  ICON_ACCOUNT_CHECK = "mdi:account-check"
964
+ ICON_AIR_FILTER = "mdi:air-filter"
957
965
  ICON_ARROW_EXPAND_VERTICAL = "mdi:arrow-expand-vertical"
958
966
  ICON_BATTERY = "mdi:battery"
959
967
  ICON_BLUETOOTH = "mdi:bluetooth"
@@ -975,6 +983,7 @@ ICON_FINGERPRINT = "mdi:fingerprint"
975
983
  ICON_FLASH = "mdi:flash"
976
984
  ICON_FLASK = "mdi:flask"
977
985
  ICON_FLASK_OUTLINE = "mdi:flask-outline"
986
+ ICON_FLASK_ROUND_BOTTOM = "mdi:flask-round-bottom"
978
987
  ICON_FLOWER = "mdi:flower"
979
988
  ICON_GAS_CYLINDER = "mdi:gas-cylinder"
980
989
  ICON_GAUGE = "mdi:gauge"
@@ -987,6 +996,7 @@ ICON_KEY_PLUS = "mdi:key-plus"
987
996
  ICON_LIGHTBULB = "mdi:lightbulb"
988
997
  ICON_MAGNET = "mdi:magnet"
989
998
  ICON_MEMORY = "mdi:memory"
999
+ ICON_MOLECULE_CO = "mdi:molecule-co"
990
1000
  ICON_MOLECULE_CO2 = "mdi:molecule-co2"
991
1001
  ICON_MOTION_SENSOR = "mdi:motion-sensor"
992
1002
  ICON_NEW_BOX = "mdi:new-box"
esphome/core/defines.h CHANGED
@@ -29,6 +29,7 @@
29
29
  #define USE_DATETIME_TIME
30
30
  #define USE_DEEP_SLEEP
31
31
  #define USE_DISPLAY
32
+ #define USE_ESP32_IMPROV_STATE_CALLBACK
32
33
  #define USE_EVENT
33
34
  #define USE_FAN
34
35
  #define USE_GRAPH
@@ -45,10 +46,11 @@
45
46
  #define USE_LVGL_BUTTONMATRIX
46
47
  #define USE_LVGL_FONT
47
48
  #define USE_LVGL_IMAGE
48
- #define USE_LVGL_KEYBOARD
49
49
  #define USE_LVGL_KEY_LISTENER
50
- #define USE_LVGL_TOUCHSCREEN
50
+ #define USE_LVGL_KEYBOARD
51
51
  #define USE_LVGL_ROTARY_ENCODER
52
+ #define USE_LVGL_TOUCHSCREEN
53
+ #define USE_MD5
52
54
  #define USE_MDNS
53
55
  #define USE_MEDIA_PLAYER
54
56
  #define USE_MQTT
esphome/core/helpers.cpp CHANGED
@@ -44,9 +44,7 @@
44
44
  #endif
45
45
  #ifdef USE_ESP32
46
46
  #include "esp32/rom/crc.h"
47
- #endif
48
47
 
49
- #if defined(CONFIG_SOC_IEEE802154_SUPPORTED) || defined(USE_ESP32_IGNORE_EFUSE_MAC_CRC)
50
48
  #include "esp_efuse.h"
51
49
  #include "esp_efuse_table.h"
52
50
  #endif
@@ -664,16 +662,20 @@ void get_mac_address_raw(uint8_t *mac) { // NOLINT(readability-non-const-parame
664
662
  static const uint8_t esphome_host_mac_address[6] = USE_ESPHOME_HOST_MAC_ADDRESS;
665
663
  memcpy(mac, esphome_host_mac_address, sizeof(esphome_host_mac_address));
666
664
  #elif defined(USE_ESP32)
667
- #if defined(CONFIG_SOC_IEEE802154_SUPPORTED) || defined(USE_ESP32_IGNORE_EFUSE_MAC_CRC)
665
+ #if defined(CONFIG_SOC_IEEE802154_SUPPORTED)
668
666
  // When CONFIG_SOC_IEEE802154_SUPPORTED is defined, esp_efuse_mac_get_default
669
- // returns the 802.15.4 EUI-64 address. Read directly from eFuse instead.
670
- // On some devices, the MAC address that is burnt into EFuse does not
671
- // match the CRC that goes along with it. For those devices, this
672
- // work-around reads and uses the MAC address as-is from EFuse,
673
- // without doing the CRC check.
674
- esp_efuse_read_field_blob(ESP_EFUSE_MAC_FACTORY, mac, 48);
667
+ // returns the 802.15.4 EUI-64 address, so we read directly from eFuse instead.
668
+ if (has_custom_mac_address()) {
669
+ esp_efuse_read_field_blob(ESP_EFUSE_MAC_CUSTOM, mac, 48);
670
+ } else {
671
+ esp_efuse_read_field_blob(ESP_EFUSE_MAC_FACTORY, mac, 48);
672
+ }
675
673
  #else
676
- esp_efuse_mac_get_default(mac);
674
+ if (has_custom_mac_address()) {
675
+ esp_efuse_mac_get_custom(mac);
676
+ } else {
677
+ esp_efuse_mac_get_default(mac);
678
+ }
677
679
  #endif
678
680
  #elif defined(USE_ESP8266)
679
681
  wifi_get_macaddr(STATION_IF, mac);
@@ -685,20 +687,54 @@ void get_mac_address_raw(uint8_t *mac) { // NOLINT(readability-non-const-parame
685
687
  // this should be an error, but that messes with CI checks. #error No mac address method defined
686
688
  #endif
687
689
  }
690
+
688
691
  std::string get_mac_address() {
689
692
  uint8_t mac[6];
690
693
  get_mac_address_raw(mac);
691
694
  return str_snprintf("%02x%02x%02x%02x%02x%02x", 12, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
692
695
  }
696
+
693
697
  std::string get_mac_address_pretty() {
694
698
  uint8_t mac[6];
695
699
  get_mac_address_raw(mac);
696
700
  return str_snprintf("%02X:%02X:%02X:%02X:%02X:%02X", 17, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
697
701
  }
702
+
698
703
  #ifdef USE_ESP32
699
704
  void set_mac_address(uint8_t *mac) { esp_base_mac_addr_set(mac); }
700
705
  #endif
701
706
 
707
+ bool has_custom_mac_address() {
708
+ #if defined(USE_ESP32) && !defined(USE_ESP32_IGNORE_EFUSE_CUSTOM_MAC)
709
+ uint8_t mac[6];
710
+ // do not use 'esp_efuse_mac_get_custom(mac)' because it drops an error in the logs whenever it fails
711
+ #ifndef USE_ESP32_VARIANT_ESP32
712
+ return (esp_efuse_read_field_blob(ESP_EFUSE_USER_DATA_MAC_CUSTOM, mac, 48) == ESP_OK) && mac_address_is_valid(mac);
713
+ #else
714
+ return (esp_efuse_read_field_blob(ESP_EFUSE_MAC_CUSTOM, mac, 48) == ESP_OK) && mac_address_is_valid(mac);
715
+ #endif
716
+ #else
717
+ return false;
718
+ #endif
719
+ }
720
+
721
+ bool mac_address_is_valid(const uint8_t *mac) {
722
+ bool is_all_zeros = true;
723
+ bool is_all_ones = true;
724
+
725
+ for (uint8_t i = 0; i < 6; i++) {
726
+ if (mac[i] != 0) {
727
+ is_all_zeros = false;
728
+ }
729
+ }
730
+ for (uint8_t i = 0; i < 6; i++) {
731
+ if (mac[i] != 0xFF) {
732
+ is_all_ones = false;
733
+ }
734
+ }
735
+ return !(is_all_zeros || is_all_ones);
736
+ }
737
+
702
738
  void delay_microseconds_safe(uint32_t us) { // avoids CPU locks that could trigger WDT or affect WiFi/BT stability
703
739
  uint32_t start = micros();
704
740
 
esphome/core/helpers.h CHANGED
@@ -635,6 +635,14 @@ std::string get_mac_address_pretty();
635
635
  void set_mac_address(uint8_t *mac);
636
636
  #endif
637
637
 
638
+ /// Check if a custom MAC address is set (ESP32 & variants)
639
+ /// @return True if a custom MAC address is set (ESP32 & variants), else false
640
+ bool has_custom_mac_address();
641
+
642
+ /// Check if the MAC address is not all zeros or all ones
643
+ /// @return True if MAC is valid, else false
644
+ bool mac_address_is_valid(const uint8_t *mac);
645
+
638
646
  /// Delay for the given amount of microseconds, possibly yielding to other processes during the wait.
639
647
  void delay_microseconds_safe(uint32_t us);
640
648
 
@@ -11,16 +11,26 @@ namespace esphome {
11
11
 
12
12
  static const char *const TAG = "ring_buffer";
13
13
 
14
+ RingBuffer::~RingBuffer() {
15
+ if (this->handle_ != nullptr) {
16
+ vStreamBufferDelete(this->handle_);
17
+ ExternalRAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE);
18
+ allocator.deallocate(this->storage_, this->size_);
19
+ }
20
+ }
21
+
14
22
  std::unique_ptr<RingBuffer> RingBuffer::create(size_t len) {
15
23
  std::unique_ptr<RingBuffer> rb = make_unique<RingBuffer>();
16
24
 
25
+ rb->size_ = len + 1;
26
+
17
27
  ExternalRAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE);
18
- rb->storage_ = allocator.allocate(len + 1);
28
+ rb->storage_ = allocator.allocate(rb->size_);
19
29
  if (rb->storage_ == nullptr) {
20
30
  return nullptr;
21
31
  }
22
32
 
23
- rb->handle_ = xStreamBufferCreateStatic(len + 1, 1, rb->storage_, &rb->structure_);
33
+ rb->handle_ = xStreamBufferCreateStatic(rb->size_, 1, rb->storage_, &rb->structure_);
24
34
  ESP_LOGD(TAG, "Created ring buffer with size %u", len);
25
35
  return rb;
26
36
  }
@@ -12,6 +12,8 @@ namespace esphome {
12
12
 
13
13
  class RingBuffer {
14
14
  public:
15
+ ~RingBuffer();
16
+
15
17
  /**
16
18
  * @brief Reads from the ring buffer, waiting up to a specified number of ticks if necessary.
17
19
  *
@@ -83,6 +85,7 @@ class RingBuffer {
83
85
  StreamBufferHandle_t handle_;
84
86
  StaticStreamBuffer_t structure_;
85
87
  uint8_t *storage_;
88
+ size_t size_{0};
86
89
  };
87
90
 
88
91
  } // namespace esphome
@@ -226,4 +226,6 @@ class _Schema(vol.Schema):
226
226
  if isinstance(schema, vol.Schema):
227
227
  schema = schema.schema
228
228
  ret = super().extend(schema, extra=extra)
229
- return _Schema(ret.schema, extra=ret.extra, extra_schemas=self._extra_schemas)
229
+ return _Schema(
230
+ ret.schema, extra=ret.extra, extra_schemas=self._extra_schemas.copy()
231
+ )
esphome/wizard.py CHANGED
@@ -90,9 +90,6 @@ esp32:
90
90
  RP2040_CONFIG = """
91
91
  rp2040:
92
92
  board: {board}
93
- framework:
94
- # Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
95
- platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git
96
93
  """
97
94
 
98
95
  BK72XX_CONFIG = """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esphome
3
- Version: 2024.9.1
3
+ Version: 2024.10.0
4
4
  Summary: Make creating custom firmwares for ESP32/ESP8266 super easy.
5
5
  Author-email: The ESPHome Authors <esphome@nabucasa.com>
6
6
  License: MIT
@@ -39,7 +39,7 @@ Requires-Dist: click ==8.1.7
39
39
  Requires-Dist: esphome-dashboard ==20240620.0
40
40
  Requires-Dist: aioesphomeapi ==24.6.2
41
41
  Requires-Dist: zeroconf ==0.132.2
42
- Requires-Dist: python-magic ==0.4.27
42
+ Requires-Dist: puremagic ==1.27
43
43
  Requires-Dist: ruamel.yaml ==0.18.6
44
44
  Requires-Dist: kconfiglib ==13.7.1
45
45
  Requires-Dist: pyparsing >=3.0
@@ -53,7 +53,7 @@ Provides-Extra: displays
53
53
  Requires-Dist: pillow ==10.2.0 ; extra == 'displays'
54
54
  Requires-Dist: cairosvg ==2.7.1 ; extra == 'displays'
55
55
  Provides-Extra: test
56
- Requires-Dist: pylint ==3.1.0 ; extra == 'test'
56
+ Requires-Dist: pylint ==3.2.7 ; extra == 'test'
57
57
  Requires-Dist: flake8 ==7.0.0 ; extra == 'test'
58
58
  Requires-Dist: black ==24.4.2 ; extra == 'test'
59
59
  Requires-Dist: pyupgrade ==3.15.2 ; extra == 'test'
@@ -74,3 +74,5 @@ Requires-Dist: hypothesis ==6.92.1 ; extra == 'test'
74
74
  For issues, please go to [the issue tracker](https://github.com/esphome/issues/issues).
75
75
 
76
76
  For feature requests, please see [feature requests](https://github.com/esphome/feature-requests/issues).
77
+
78
+ [![ESPHome - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/esphome.png)](https://www.openhomefoundation.org/)