esphome 2024.9.2__py3-none-any.whl → 2024.10.0b1__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 (188) 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/button/__init__.py +3 -4
  27. esphome/components/ch422g/__init__.py +26 -17
  28. esphome/components/ch422g/ch422g.cpp +66 -49
  29. esphome/components/ch422g/ch422g.h +17 -19
  30. esphome/components/climate/__init__.py +3 -4
  31. esphome/components/cover/__init__.py +4 -5
  32. esphome/components/cse7766/cse7766.cpp +11 -0
  33. esphome/components/cse7766/cse7766.h +4 -0
  34. esphome/components/cse7766/sensor.py +13 -1
  35. esphome/components/cst816/touchscreen/__init__.py +7 -4
  36. esphome/components/cst816/touchscreen/cst816_touchscreen.cpp +20 -19
  37. esphome/components/cst816/touchscreen/cst816_touchscreen.h +2 -0
  38. esphome/components/datetime/__init__.py +21 -14
  39. esphome/components/datetime/datetime_base.h +8 -1
  40. esphome/components/datetime/datetime_entity.cpp +2 -0
  41. esphome/components/datetime/datetime_entity.h +2 -0
  42. esphome/components/datetime/time_entity.cpp +2 -0
  43. esphome/components/datetime/time_entity.h +2 -0
  44. esphome/components/esp32/__init__.py +20 -4
  45. esphome/components/esp32_improv/__init__.py +82 -1
  46. esphome/components/esp32_improv/automation.h +72 -0
  47. esphome/components/esp32_improv/esp32_improv_component.cpp +13 -5
  48. esphome/components/esp32_improv/esp32_improv_component.h +15 -0
  49. esphome/components/ethernet/__init__.py +5 -0
  50. esphome/components/ethernet/ethernet_component.cpp +13 -0
  51. esphome/components/ethernet/ethernet_component.h +1 -0
  52. esphome/components/fan/__init__.py +3 -4
  53. esphome/components/gp2y1010au0f/__init__.py +0 -0
  54. esphome/components/gp2y1010au0f/gp2y1010au0f.cpp +67 -0
  55. esphome/components/gp2y1010au0f/gp2y1010au0f.h +52 -0
  56. esphome/components/gp2y1010au0f/sensor.py +61 -0
  57. esphome/components/gpio_expander/__init__.py +0 -0
  58. esphome/components/gpio_expander/cached_gpio.h +38 -0
  59. esphome/components/grove_gas_mc_v2/__init__.py +0 -0
  60. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +88 -0
  61. esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.h +39 -0
  62. esphome/components/grove_gas_mc_v2/sensor.py +77 -0
  63. esphome/components/haier/climate.py +4 -3
  64. esphome/components/haier/haier_base.cpp +63 -8
  65. esphome/components/haier/haier_base.h +29 -3
  66. esphome/components/haier/hon_climate.cpp +122 -65
  67. esphome/components/haier/hon_climate.h +18 -2
  68. esphome/components/haier/smartair2_climate.cpp +21 -21
  69. esphome/components/haier/switch/__init__.py +91 -0
  70. esphome/components/haier/switch/beeper.cpp +14 -0
  71. esphome/components/haier/switch/beeper.h +18 -0
  72. esphome/components/haier/switch/display.cpp +14 -0
  73. esphome/components/haier/switch/display.h +18 -0
  74. esphome/components/haier/switch/health_mode.cpp +14 -0
  75. esphome/components/haier/switch/health_mode.h +18 -0
  76. esphome/components/haier/switch/quiet_mode.cpp +14 -0
  77. esphome/components/haier/switch/quiet_mode.h +18 -0
  78. esphome/components/hmac_md5/hmac_md5.cpp +2 -0
  79. esphome/components/hmac_md5/hmac_md5.h +2 -1
  80. esphome/components/i2s_audio/speaker/__init__.py +19 -0
  81. esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +1 -1
  82. esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +2 -0
  83. esphome/components/ili9xxx/ili9xxx_display.h +1 -0
  84. esphome/components/image/__init__.py +12 -12
  85. esphome/components/image/image.cpp +44 -0
  86. esphome/components/image/image.h +17 -2
  87. esphome/components/inkplate6/display.py +2 -0
  88. esphome/components/inkplate6/inkplate.h +30 -2
  89. esphome/components/light/__init__.py +3 -4
  90. esphome/components/lock/__init__.py +3 -4
  91. esphome/components/lvgl/__init__.py +16 -5
  92. esphome/components/lvgl/defines.py +1 -0
  93. esphome/components/lvgl/hello_world.py +64 -0
  94. esphome/components/lvgl/lv_validation.py +159 -3
  95. esphome/components/lvgl/lvgl_esphome.cpp +0 -43
  96. esphome/components/lvgl/lvgl_esphome.h +0 -4
  97. esphome/components/lvgl/styles.py +3 -2
  98. esphome/components/lvgl/text/__init__.py +3 -3
  99. esphome/components/lvgl/widgets/__init__.py +2 -0
  100. esphome/components/lvgl/widgets/animimg.py +3 -4
  101. esphome/components/lvgl/widgets/dropdown.py +5 -1
  102. esphome/components/lvgl/widgets/meter.py +16 -11
  103. esphome/components/md5/__init__.py +6 -0
  104. esphome/components/md5/md5.cpp +2 -0
  105. esphome/components/md5/md5.h +2 -0
  106. esphome/components/micro_wake_word/__init__.py +7 -0
  107. esphome/components/mics_4514/sensor.py +11 -26
  108. esphome/components/modbus_controller/__init__.py +7 -5
  109. esphome/components/modbus_controller/binary_sensor/__init__.py +6 -6
  110. esphome/components/modbus_controller/number/__init__.py +5 -6
  111. esphome/components/modbus_controller/output/__init__.py +10 -14
  112. esphome/components/modbus_controller/select/__init__.py +1 -1
  113. esphome/components/modbus_controller/sensor/__init__.py +7 -7
  114. esphome/components/modbus_controller/switch/__init__.py +6 -7
  115. esphome/components/modbus_controller/text_sensor/__init__.py +8 -9
  116. esphome/components/mqtt/__init__.py +3 -0
  117. esphome/components/mqtt/mqtt_client.cpp +2 -0
  118. esphome/components/mqtt/mqtt_client.h +2 -0
  119. esphome/components/nau7802/__init__.py +0 -0
  120. esphome/components/nau7802/nau7802.cpp +323 -0
  121. esphome/components/nau7802/nau7802.h +121 -0
  122. esphome/components/nau7802/sensor.py +134 -0
  123. esphome/components/nextion/base_component.py +1 -0
  124. esphome/components/nextion/display.py +4 -0
  125. esphome/components/nextion/nextion.cpp +19 -4
  126. esphome/components/nextion/nextion.h +16 -0
  127. esphome/components/npi19/__init__.py +0 -0
  128. esphome/components/npi19/npi19.cpp +111 -0
  129. esphome/components/npi19/npi19.h +30 -0
  130. esphome/components/npi19/sensor.py +52 -0
  131. esphome/components/number/__init__.py +3 -5
  132. esphome/components/online_image/__init__.py +1 -1
  133. esphome/components/online_image/online_image.h +1 -2
  134. esphome/components/opentherm/__init__.py +57 -0
  135. esphome/components/opentherm/hub.cpp +277 -0
  136. esphome/components/opentherm/hub.h +110 -0
  137. esphome/components/opentherm/opentherm.cpp +568 -0
  138. esphome/components/opentherm/opentherm.h +347 -0
  139. esphome/components/pulse_counter/pulse_counter_sensor.cpp +8 -1
  140. esphome/components/pulse_counter/pulse_counter_sensor.h +1 -0
  141. esphome/components/radon_eye_ble/radon_eye_listener.cpp +10 -3
  142. esphome/components/remote_transmitter/__init__.py +18 -2
  143. esphome/components/remote_transmitter/remote_transmitter.h +6 -0
  144. esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +2 -0
  145. esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +2 -0
  146. esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +2 -0
  147. esphome/components/select/__init__.py +3 -4
  148. esphome/components/sensor/__init__.py +3 -4
  149. esphome/components/st7701s/st7701s.cpp +21 -8
  150. esphome/components/st7701s/st7701s.h +2 -0
  151. esphome/components/switch/__init__.py +3 -4
  152. esphome/components/tca9555/__init__.py +72 -0
  153. esphome/components/tca9555/tca9555.cpp +140 -0
  154. esphome/components/tca9555/tca9555.h +64 -0
  155. esphome/components/tcs34725/tcs34725.cpp +62 -64
  156. esphome/components/tem3200/__init__.py +0 -0
  157. esphome/components/tem3200/sensor.py +55 -0
  158. esphome/components/tem3200/tem3200.cpp +151 -0
  159. esphome/components/tem3200/tem3200.h +30 -0
  160. esphome/components/template/binary_sensor/__init__.py +19 -6
  161. esphome/components/text/__init__.py +3 -4
  162. esphome/components/text_sensor/__init__.py +3 -4
  163. esphome/components/thermostat/climate.py +11 -9
  164. esphome/components/thermostat/thermostat_climate.cpp +21 -15
  165. esphome/components/tm1638/binary_sensor/__init__.py +3 -2
  166. esphome/components/tm1638/display.py +5 -5
  167. esphome/components/tm1638/output/__init__.py +3 -2
  168. esphome/components/tm1638/switch/__init__.py +3 -2
  169. esphome/components/update/__init__.py +3 -4
  170. esphome/components/valve/__init__.py +3 -4
  171. esphome/components/web_server/__init__.py +78 -22
  172. esphome/components/web_server/server_index_v3.h +3989 -3979
  173. esphome/components/web_server/web_server.cpp +212 -33
  174. esphome/components/web_server/web_server.h +10 -1
  175. esphome/components/wifi/wifi_component_esp_idf.cpp +4 -5
  176. esphome/config_validation.py +1 -0
  177. esphome/const.py +12 -2
  178. esphome/core/defines.h +4 -2
  179. esphome/core/helpers.cpp +46 -10
  180. esphome/core/helpers.h +8 -0
  181. esphome/core/ring_buffer.cpp +12 -2
  182. esphome/core/ring_buffer.h +3 -0
  183. {esphome-2024.9.2.dist-info → esphome-2024.10.0b1.dist-info}/METADATA +5 -3
  184. {esphome-2024.9.2.dist-info → esphome-2024.10.0b1.dist-info}/RECORD +188 -139
  185. {esphome-2024.9.2.dist-info → esphome-2024.10.0b1.dist-info}/LICENSE +0 -0
  186. {esphome-2024.9.2.dist-info → esphome-2024.10.0b1.dist-info}/WHEEL +0 -0
  187. {esphome-2024.9.2.dist-info → esphome-2024.10.0b1.dist-info}/entry_points.txt +0 -0
  188. {esphome-2024.9.2.dist-info → esphome-2024.10.0b1.dist-info}/top_level.txt +0 -0
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esphome
3
- Version: 2024.9.2
3
+ Version: 2024.10.0b1
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/)