esphome 2024.7.0b3__py3-none-any.whl → 2024.7.0b4__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.
@@ -1,14 +1,17 @@
1
1
  #ifdef USE_ESP32_FRAMEWORK_ARDUINO
2
2
  #include "esphome/core/defines.h"
3
+ #include "esphome/core/log.h"
3
4
 
4
- #include "ota_backend_arduino_esp32.h"
5
5
  #include "ota_backend.h"
6
+ #include "ota_backend_arduino_esp32.h"
6
7
 
7
8
  #include <Update.h>
8
9
 
9
10
  namespace esphome {
10
11
  namespace ota {
11
12
 
13
+ static const char *const TAG = "ota.arduino_esp32";
14
+
12
15
  std::unique_ptr<ota::OTABackend> make_ota_backend() { return make_unique<ota::ArduinoESP32OTABackend>(); }
13
16
 
14
17
  OTAResponseTypes ArduinoESP32OTABackend::begin(size_t image_size) {
@@ -20,6 +23,9 @@ OTAResponseTypes ArduinoESP32OTABackend::begin(size_t image_size) {
20
23
  uint8_t error = Update.getError();
21
24
  if (error == UPDATE_ERROR_SIZE)
22
25
  return OTA_RESPONSE_ERROR_ESP32_NOT_ENOUGH_SPACE;
26
+
27
+ ESP_LOGE(TAG, "Begin error: %d", error);
28
+
23
29
  return OTA_RESPONSE_ERROR_UNKNOWN;
24
30
  }
25
31
 
@@ -27,16 +33,25 @@ void ArduinoESP32OTABackend::set_update_md5(const char *md5) { Update.setMD5(md5
27
33
 
28
34
  OTAResponseTypes ArduinoESP32OTABackend::write(uint8_t *data, size_t len) {
29
35
  size_t written = Update.write(data, len);
30
- if (written != len) {
31
- return OTA_RESPONSE_ERROR_WRITING_FLASH;
36
+ if (written == len) {
37
+ return OTA_RESPONSE_OK;
32
38
  }
33
- return OTA_RESPONSE_OK;
39
+
40
+ uint8_t error = Update.getError();
41
+ ESP_LOGE(TAG, "Write error: %d", error);
42
+
43
+ return OTA_RESPONSE_ERROR_WRITING_FLASH;
34
44
  }
35
45
 
36
46
  OTAResponseTypes ArduinoESP32OTABackend::end() {
37
- if (!Update.end())
38
- return OTA_RESPONSE_ERROR_UPDATE_END;
39
- return OTA_RESPONSE_OK;
47
+ if (Update.end()) {
48
+ return OTA_RESPONSE_OK;
49
+ }
50
+
51
+ uint8_t error = Update.getError();
52
+ ESP_LOGE(TAG, "End error: %d", error);
53
+
54
+ return OTA_RESPONSE_ERROR_UPDATE_END;
40
55
  }
41
56
 
42
57
  void ArduinoESP32OTABackend::abort() { Update.abort(); }
@@ -1,16 +1,19 @@
1
1
  #ifdef USE_ARDUINO
2
2
  #ifdef USE_ESP8266
3
- #include "ota_backend.h"
4
3
  #include "ota_backend_arduino_esp8266.h"
4
+ #include "ota_backend.h"
5
5
 
6
- #include "esphome/core/defines.h"
7
6
  #include "esphome/components/esp8266/preferences.h"
7
+ #include "esphome/core/defines.h"
8
+ #include "esphome/core/log.h"
8
9
 
9
10
  #include <Updater.h>
10
11
 
11
12
  namespace esphome {
12
13
  namespace ota {
13
14
 
15
+ static const char *const TAG = "ota.arduino_esp8266";
16
+
14
17
  std::unique_ptr<ota::OTABackend> make_ota_backend() { return make_unique<ota::ArduinoESP8266OTABackend>(); }
15
18
 
16
19
  OTAResponseTypes ArduinoESP8266OTABackend::begin(size_t image_size) {
@@ -29,6 +32,9 @@ OTAResponseTypes ArduinoESP8266OTABackend::begin(size_t image_size) {
29
32
  return OTA_RESPONSE_ERROR_WRONG_CURRENT_FLASH_CONFIG;
30
33
  if (error == UPDATE_ERROR_SPACE)
31
34
  return OTA_RESPONSE_ERROR_ESP8266_NOT_ENOUGH_SPACE;
35
+
36
+ ESP_LOGE(TAG, "Begin error: %d", error);
37
+
32
38
  return OTA_RESPONSE_ERROR_UNKNOWN;
33
39
  }
34
40
 
@@ -36,16 +42,25 @@ void ArduinoESP8266OTABackend::set_update_md5(const char *md5) { Update.setMD5(m
36
42
 
37
43
  OTAResponseTypes ArduinoESP8266OTABackend::write(uint8_t *data, size_t len) {
38
44
  size_t written = Update.write(data, len);
39
- if (written != len) {
40
- return OTA_RESPONSE_ERROR_WRITING_FLASH;
45
+ if (written == len) {
46
+ return OTA_RESPONSE_OK;
41
47
  }
42
- return OTA_RESPONSE_OK;
48
+
49
+ uint8_t error = Update.getError();
50
+ ESP_LOGE(TAG, "Write error: %d", error);
51
+
52
+ return OTA_RESPONSE_ERROR_WRITING_FLASH;
43
53
  }
44
54
 
45
55
  OTAResponseTypes ArduinoESP8266OTABackend::end() {
46
- if (!Update.end())
47
- return OTA_RESPONSE_ERROR_UPDATE_END;
48
- return OTA_RESPONSE_OK;
56
+ if (Update.end()) {
57
+ return OTA_RESPONSE_OK;
58
+ }
59
+
60
+ uint8_t error = Update.getError();
61
+ ESP_LOGE(TAG, "End error: %d", error);
62
+
63
+ return OTA_RESPONSE_ERROR_UPDATE_END;
49
64
  }
50
65
 
51
66
  void ArduinoESP8266OTABackend::abort() {
@@ -1,14 +1,17 @@
1
1
  #ifdef USE_LIBRETINY
2
- #include "ota_backend.h"
3
2
  #include "ota_backend_arduino_libretiny.h"
3
+ #include "ota_backend.h"
4
4
 
5
5
  #include "esphome/core/defines.h"
6
+ #include "esphome/core/log.h"
6
7
 
7
8
  #include <Update.h>
8
9
 
9
10
  namespace esphome {
10
11
  namespace ota {
11
12
 
13
+ static const char *const TAG = "ota.arduino_libretiny";
14
+
12
15
  std::unique_ptr<ota::OTABackend> make_ota_backend() { return make_unique<ota::ArduinoLibreTinyOTABackend>(); }
13
16
 
14
17
  OTAResponseTypes ArduinoLibreTinyOTABackend::begin(size_t image_size) {
@@ -20,6 +23,9 @@ OTAResponseTypes ArduinoLibreTinyOTABackend::begin(size_t image_size) {
20
23
  uint8_t error = Update.getError();
21
24
  if (error == UPDATE_ERROR_SIZE)
22
25
  return OTA_RESPONSE_ERROR_ESP32_NOT_ENOUGH_SPACE;
26
+
27
+ ESP_LOGE(TAG, "Begin error: %d", error);
28
+
23
29
  return OTA_RESPONSE_ERROR_UNKNOWN;
24
30
  }
25
31
 
@@ -27,16 +33,25 @@ void ArduinoLibreTinyOTABackend::set_update_md5(const char *md5) { Update.setMD5
27
33
 
28
34
  OTAResponseTypes ArduinoLibreTinyOTABackend::write(uint8_t *data, size_t len) {
29
35
  size_t written = Update.write(data, len);
30
- if (written != len) {
31
- return OTA_RESPONSE_ERROR_WRITING_FLASH;
36
+ if (written == len) {
37
+ return OTA_RESPONSE_OK;
32
38
  }
33
- return OTA_RESPONSE_OK;
39
+
40
+ uint8_t error = Update.getError();
41
+ ESP_LOGE(TAG, "Write error: %d", error);
42
+
43
+ return OTA_RESPONSE_ERROR_WRITING_FLASH;
34
44
  }
35
45
 
36
46
  OTAResponseTypes ArduinoLibreTinyOTABackend::end() {
37
- if (!Update.end())
38
- return OTA_RESPONSE_ERROR_UPDATE_END;
39
- return OTA_RESPONSE_OK;
47
+ if (Update.end()) {
48
+ return OTA_RESPONSE_OK;
49
+ }
50
+
51
+ uint8_t error = Update.getError();
52
+ ESP_LOGE(TAG, "End error: %d", error);
53
+
54
+ return OTA_RESPONSE_ERROR_UPDATE_END;
40
55
  }
41
56
 
42
57
  void ArduinoLibreTinyOTABackend::abort() { Update.abort(); }
@@ -1,16 +1,19 @@
1
1
  #ifdef USE_ARDUINO
2
2
  #ifdef USE_RP2040
3
- #include "ota_backend.h"
4
3
  #include "ota_backend_arduino_rp2040.h"
4
+ #include "ota_backend.h"
5
5
 
6
6
  #include "esphome/components/rp2040/preferences.h"
7
7
  #include "esphome/core/defines.h"
8
+ #include "esphome/core/log.h"
8
9
 
9
10
  #include <Updater.h>
10
11
 
11
12
  namespace esphome {
12
13
  namespace ota {
13
14
 
15
+ static const char *const TAG = "ota.arduino_rp2040";
16
+
14
17
  std::unique_ptr<ota::OTABackend> make_ota_backend() { return make_unique<ota::ArduinoRP2040OTABackend>(); }
15
18
 
16
19
  OTAResponseTypes ArduinoRP2040OTABackend::begin(size_t image_size) {
@@ -29,6 +32,9 @@ OTAResponseTypes ArduinoRP2040OTABackend::begin(size_t image_size) {
29
32
  return OTA_RESPONSE_ERROR_WRONG_CURRENT_FLASH_CONFIG;
30
33
  if (error == UPDATE_ERROR_SPACE)
31
34
  return OTA_RESPONSE_ERROR_RP2040_NOT_ENOUGH_SPACE;
35
+
36
+ ESP_LOGE(TAG, "Begin error: %d", error);
37
+
32
38
  return OTA_RESPONSE_ERROR_UNKNOWN;
33
39
  }
34
40
 
@@ -36,16 +42,25 @@ void ArduinoRP2040OTABackend::set_update_md5(const char *md5) { Update.setMD5(md
36
42
 
37
43
  OTAResponseTypes ArduinoRP2040OTABackend::write(uint8_t *data, size_t len) {
38
44
  size_t written = Update.write(data, len);
39
- if (written != len) {
40
- return OTA_RESPONSE_ERROR_WRITING_FLASH;
45
+ if (written == len) {
46
+ return OTA_RESPONSE_OK;
41
47
  }
42
- return OTA_RESPONSE_OK;
48
+
49
+ uint8_t error = Update.getError();
50
+ ESP_LOGE(TAG, "Write error: %d", error);
51
+
52
+ return OTA_RESPONSE_ERROR_WRITING_FLASH;
43
53
  }
44
54
 
45
55
  OTAResponseTypes ArduinoRP2040OTABackend::end() {
46
- if (!Update.end())
47
- return OTA_RESPONSE_ERROR_UPDATE_END;
48
- return OTA_RESPONSE_OK;
56
+ if (Update.end()) {
57
+ return OTA_RESPONSE_OK;
58
+ }
59
+
60
+ uint8_t error = Update.getError();
61
+ ESP_LOGE(TAG, "End error: %d", error);
62
+
63
+ return OTA_RESPONSE_ERROR_UPDATE_END;
49
64
  }
50
65
 
51
66
  void ArduinoRP2040OTABackend::abort() {
esphome/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants used by esphome."""
2
2
 
3
- __version__ = "2024.7.0b3"
3
+ __version__ = "2024.7.0b4"
4
4
 
5
5
  ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
6
6
  VALID_SUBSTITUTIONS_CHARACTERS = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: esphome
3
- Version: 2024.7.0b3
3
+ Version: 2024.7.0b4
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
@@ -5,7 +5,7 @@ esphome/codegen.py,sha256=LCJVpAwy1L9DTBsIvbgAbHj1TOXUSPgBoN--aio0gBk,1855
5
5
  esphome/config.py,sha256=wztK2UmO7-hc6HFDAi6YWtrPVy5mH0diKuqpsWp4-XA,39616
6
6
  esphome/config_helpers.py,sha256=MKf_wzO35nn41FvigXE0iYKDslPgL2ruf8R-EPtTT2I,3256
7
7
  esphome/config_validation.py,sha256=G79LGVIh5BdpGkzuehkm7Db_llpbC2of4dKqZEpHc3A,64838
8
- esphome/const.py,sha256=QXPuiRfzBxts2SEE3uaaOGfXjxCEcXvMgPpU5qwqNrA,38954
8
+ esphome/const.py,sha256=SUZvcz_XkgCQ58OeMcC8KYw3HPgVbgho5Btk125vLtA,38954
9
9
  esphome/coroutine.py,sha256=IG2kC92OrenyiRm7Qo9uC-4qU4b4-Lmj0TkMIjRG2RY,9344
10
10
  esphome/cpp_generator.py,sha256=hW2EfubUiildhKXZIdV8Dr3Q9TM5oHybFwiTo5-vEUE,31203
11
11
  esphome/cpp_helpers.py,sha256=KadRBBoo4QRT-VwdWFtvxv_FYjqhZTkBhfMX-JhEMwg,4803
@@ -1775,13 +1775,13 @@ esphome/components/ota/__init__.py,sha256=EiXnjLtJX3CXeDGRsqLnp5I4xQiy3Yhcy24mqv
1775
1775
  esphome/components/ota/automation.h,sha256=UaasWG6gZG59MtC5DHHfMhRb7BXYmLlkOyYujZReEV0,2044
1776
1776
  esphome/components/ota/ota_backend.cpp,sha256=IfpR0mvzSs9ugJa2LRi4AtYHT4Ht6PoS9BY5Ydjs_eE,587
1777
1777
  esphome/components/ota/ota_backend.h,sha256=ILfnmlVzp0qhHFv13jZ6GQ7MLgKf5ICtL6xI4ojg4K8,2806
1778
- esphome/components/ota/ota_backend_arduino_esp32.cpp,sha256=nq7hHkMqwwZRDrwgHq_yO3-fE_XiZYkricVEcomP0GU,1219
1778
+ esphome/components/ota/ota_backend_arduino_esp32.cpp,sha256=gEExNdFUN-iiOX3rVUXBiRZcE8cfEk0G3chGhTaPYr0,1514
1779
1779
  esphome/components/ota/ota_backend_arduino_esp32.h,sha256=h0oH0gREs7M6hW_BlGHHFFml14IJYx7IpKpsVaHJ554,610
1780
- esphome/components/ota/ota_backend_arduino_esp8266.cpp,sha256=xM2zLeWGKB64Xk2qmYOipZArHSNrlYZVWpH7zl9Fu3Y,1650
1780
+ esphome/components/ota/ota_backend_arduino_esp8266.cpp,sha256=lJgvlbP3v6piuoE_klojKI7si_2g0pL3QN3CIU09lmY,1947
1781
1781
  esphome/components/ota/ota_backend_arduino_esp8266.h,sha256=PABg5GIPA75xe9KpcP2Jc_N_U0ygOu-KPGgVE-sNotU,712
1782
- esphome/components/ota/ota_backend_arduino_libretiny.cpp,sha256=CjZduWnNBolKArayIWu6b3SwvRpv5c9Yu2UEOfDZIKU,1219
1782
+ esphome/components/ota/ota_backend_arduino_libretiny.cpp,sha256=4DEgWdOZQAeTNZiv0tKDyILZxpfj7i0hS37IvAKyXRw,1518
1783
1783
  esphome/components/ota/ota_backend_arduino_libretiny.h,sha256=7RnBge-XizF0KQtft_Naeh1-Gj0yO2Y_hJW6mCXO-gQ,552
1784
- esphome/components/ota/ota_backend_arduino_rp2040.cpp,sha256=uoJnB6iCjW42Ykoxmsz22m6ieJyrKmz2EO3gkjWw0WQ,1669
1784
+ esphome/components/ota/ota_backend_arduino_rp2040.cpp,sha256=H2TUIWJMHCeArtr-0IcZPgyDI9DNOZfzP8F47lPeTZU,1965
1785
1785
  esphome/components/ota/ota_backend_arduino_rp2040.h,sha256=6E54dND3ToVbYVsWRsLPpZ8o3DytNhtZg1IVXTPyKx4,618
1786
1786
  esphome/components/ota/ota_backend_esp_idf.cpp,sha256=_TBWW23aHSFo5P8pHSqexR0LgnOB4z5b-3Lw0vliWvc,3328
1787
1787
  esphome/components/ota/ota_backend_esp_idf.h,sha256=aiHISZQjSxaRWuq_4ZGAEuP8kCG0BccYAbJ9kx6WvhQ,725
@@ -3119,9 +3119,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
3119
3119
  esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
3120
3120
  esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
3121
3121
  esphome/dashboard/util/text.py,sha256=ENDnfN4O0NdA3CKVJjQYabFbwbrsIhVKrAMQe53qYu4,534
3122
- esphome-2024.7.0b3.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3123
- esphome-2024.7.0b3.dist-info/METADATA,sha256=e3LWrKNMO9xv3Y6LKKcJCnNzxGQVVig2aZ5AsGfou1c,3265
3124
- esphome-2024.7.0b3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3125
- esphome-2024.7.0b3.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3126
- esphome-2024.7.0b3.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3127
- esphome-2024.7.0b3.dist-info/RECORD,,
3122
+ esphome-2024.7.0b4.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3123
+ esphome-2024.7.0b4.dist-info/METADATA,sha256=HBcaZkRTFrujwOsQdf8dccMWstRkQ4sQt-QIx91G-F4,3265
3124
+ esphome-2024.7.0b4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3125
+ esphome-2024.7.0b4.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3126
+ esphome-2024.7.0b4.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3127
+ esphome-2024.7.0b4.dist-info/RECORD,,