esphome 2024.12.0b3__py3-none-any.whl → 2024.12.2__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.
- esphome/components/esp32/__init__.py +3 -0
- esphome/components/esp32_ble/ble_advertising.cpp +1 -1
- esphome/const.py +1 -1
- esphome/core/ring_buffer.cpp +73 -17
- esphome/core/ring_buffer.h +9 -4
- {esphome-2024.12.0b3.dist-info → esphome-2024.12.2.dist-info}/METADATA +1 -1
- {esphome-2024.12.0b3.dist-info → esphome-2024.12.2.dist-info}/RECORD +11 -11
- {esphome-2024.12.0b3.dist-info → esphome-2024.12.2.dist-info}/LICENSE +0 -0
- {esphome-2024.12.0b3.dist-info → esphome-2024.12.2.dist-info}/WHEEL +0 -0
- {esphome-2024.12.0b3.dist-info → esphome-2024.12.2.dist-info}/entry_points.txt +0 -0
- {esphome-2024.12.0b3.dist-info → esphome-2024.12.2.dist-info}/top_level.txt +0 -0
@@ -602,6 +602,9 @@ async def to_code(config):
|
|
602
602
|
cg.add_platformio_option(
|
603
603
|
"platform_packages", ["espressif/toolchain-esp32ulp@2.35.0-20220830"]
|
604
604
|
)
|
605
|
+
add_idf_sdkconfig_option(
|
606
|
+
f"CONFIG_ESPTOOLPY_FLASHSIZE_{config[CONF_FLASH_SIZE]}", True
|
607
|
+
)
|
605
608
|
add_idf_sdkconfig_option("CONFIG_PARTITION_TABLE_SINGLE_APP", False)
|
606
609
|
add_idf_sdkconfig_option("CONFIG_PARTITION_TABLE_CUSTOM", True)
|
607
610
|
add_idf_sdkconfig_option(
|
@@ -83,7 +83,7 @@ esp_err_t BLEAdvertising::services_advertisement_() {
|
|
83
83
|
esp_err_t err;
|
84
84
|
|
85
85
|
this->advertising_data_.set_scan_rsp = false;
|
86
|
-
this->advertising_data_.include_name =
|
86
|
+
this->advertising_data_.include_name = !this->scan_response_;
|
87
87
|
this->advertising_data_.include_txpower = !this->scan_response_;
|
88
88
|
err = esp_ble_gap_config_adv_data(&this->advertising_data_);
|
89
89
|
if (err != ESP_OK) {
|
esphome/const.py
CHANGED
esphome/core/ring_buffer.cpp
CHANGED
@@ -13,8 +13,8 @@ static const char *const TAG = "ring_buffer";
|
|
13
13
|
|
14
14
|
RingBuffer::~RingBuffer() {
|
15
15
|
if (this->handle_ != nullptr) {
|
16
|
-
|
17
|
-
|
16
|
+
vRingbufferDelete(this->handle_);
|
17
|
+
RAMAllocator<uint8_t> allocator(RAMAllocator<uint8_t>::ALLOW_FAILURE);
|
18
18
|
allocator.deallocate(this->storage_, this->size_);
|
19
19
|
}
|
20
20
|
}
|
@@ -22,26 +22,49 @@ RingBuffer::~RingBuffer() {
|
|
22
22
|
std::unique_ptr<RingBuffer> RingBuffer::create(size_t len) {
|
23
23
|
std::unique_ptr<RingBuffer> rb = make_unique<RingBuffer>();
|
24
24
|
|
25
|
-
rb->size_ = len
|
25
|
+
rb->size_ = len;
|
26
26
|
|
27
|
-
|
27
|
+
RAMAllocator<uint8_t> allocator(RAMAllocator<uint8_t>::ALLOW_FAILURE);
|
28
28
|
rb->storage_ = allocator.allocate(rb->size_);
|
29
29
|
if (rb->storage_ == nullptr) {
|
30
30
|
return nullptr;
|
31
31
|
}
|
32
32
|
|
33
|
-
rb->handle_ =
|
33
|
+
rb->handle_ = xRingbufferCreateStatic(rb->size_, RINGBUF_TYPE_BYTEBUF, rb->storage_, &rb->structure_);
|
34
34
|
ESP_LOGD(TAG, "Created ring buffer with size %u", len);
|
35
|
+
|
35
36
|
return rb;
|
36
37
|
}
|
37
38
|
|
38
39
|
size_t RingBuffer::read(void *data, size_t len, TickType_t ticks_to_wait) {
|
39
|
-
|
40
|
-
|
40
|
+
size_t bytes_read = 0;
|
41
|
+
|
42
|
+
void *buffer_data = xRingbufferReceiveUpTo(this->handle_, &bytes_read, ticks_to_wait, len);
|
43
|
+
|
44
|
+
if (buffer_data == nullptr) {
|
45
|
+
return 0;
|
46
|
+
}
|
47
|
+
|
48
|
+
std::memcpy(data, buffer_data, bytes_read);
|
41
49
|
|
42
|
-
|
50
|
+
vRingbufferReturnItem(this->handle_, buffer_data);
|
43
51
|
|
44
|
-
|
52
|
+
if (bytes_read < len) {
|
53
|
+
// Data may have wrapped around, so read a second time to receive the remainder
|
54
|
+
size_t follow_up_bytes_read = 0;
|
55
|
+
size_t bytes_remaining = len - bytes_read;
|
56
|
+
|
57
|
+
buffer_data = xRingbufferReceiveUpTo(this->handle_, &follow_up_bytes_read, 0, bytes_remaining);
|
58
|
+
|
59
|
+
if (buffer_data == nullptr) {
|
60
|
+
return bytes_read;
|
61
|
+
}
|
62
|
+
|
63
|
+
std::memcpy((void *) ((uint8_t *) (data) + bytes_read), buffer_data, follow_up_bytes_read);
|
64
|
+
|
65
|
+
vRingbufferReturnItem(this->handle_, buffer_data);
|
66
|
+
bytes_read += follow_up_bytes_read;
|
67
|
+
}
|
45
68
|
|
46
69
|
return bytes_read;
|
47
70
|
}
|
@@ -49,22 +72,55 @@ size_t RingBuffer::read(void *data, size_t len, TickType_t ticks_to_wait) {
|
|
49
72
|
size_t RingBuffer::write(const void *data, size_t len) {
|
50
73
|
size_t free = this->free();
|
51
74
|
if (free < len) {
|
52
|
-
|
53
|
-
|
54
|
-
xStreamBufferReceive(this->handle_, discard, needed, 0);
|
75
|
+
// Free enough space in the ring buffer to fit the new data
|
76
|
+
this->discard_bytes_(len - free);
|
55
77
|
}
|
56
|
-
return
|
78
|
+
return this->write_without_replacement(data, len, 0);
|
57
79
|
}
|
58
80
|
|
59
81
|
size_t RingBuffer::write_without_replacement(const void *data, size_t len, TickType_t ticks_to_wait) {
|
60
|
-
|
82
|
+
if (!xRingbufferSend(this->handle_, data, len, ticks_to_wait)) {
|
83
|
+
// Couldn't fit all the data, so only write what will fit
|
84
|
+
size_t free = std::min(this->free(), len);
|
85
|
+
if (xRingbufferSend(this->handle_, data, free, 0)) {
|
86
|
+
return free;
|
87
|
+
}
|
88
|
+
return 0;
|
89
|
+
}
|
90
|
+
return len;
|
91
|
+
}
|
92
|
+
|
93
|
+
size_t RingBuffer::available() const {
|
94
|
+
UBaseType_t ux_items_waiting = 0;
|
95
|
+
vRingbufferGetInfo(this->handle_, nullptr, nullptr, nullptr, nullptr, &ux_items_waiting);
|
96
|
+
return ux_items_waiting;
|
61
97
|
}
|
62
98
|
|
63
|
-
size_t RingBuffer::
|
99
|
+
size_t RingBuffer::free() const { return xRingbufferGetCurFreeSize(this->handle_); }
|
100
|
+
|
101
|
+
BaseType_t RingBuffer::reset() {
|
102
|
+
// Discards all the available data
|
103
|
+
return this->discard_bytes_(this->available());
|
104
|
+
}
|
64
105
|
|
65
|
-
|
106
|
+
bool RingBuffer::discard_bytes_(size_t discard_bytes) {
|
107
|
+
size_t bytes_read = 0;
|
66
108
|
|
67
|
-
|
109
|
+
void *buffer_data = xRingbufferReceiveUpTo(this->handle_, &bytes_read, 0, discard_bytes);
|
110
|
+
if (buffer_data != nullptr)
|
111
|
+
vRingbufferReturnItem(this->handle_, buffer_data);
|
112
|
+
|
113
|
+
if (bytes_read < discard_bytes) {
|
114
|
+
size_t wrapped_bytes_read = 0;
|
115
|
+
buffer_data = xRingbufferReceiveUpTo(this->handle_, &wrapped_bytes_read, 0, discard_bytes - bytes_read);
|
116
|
+
if (buffer_data != nullptr) {
|
117
|
+
vRingbufferReturnItem(this->handle_, buffer_data);
|
118
|
+
bytes_read += wrapped_bytes_read;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
return (bytes_read == discard_bytes);
|
123
|
+
}
|
68
124
|
|
69
125
|
} // namespace esphome
|
70
126
|
|
esphome/core/ring_buffer.h
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#ifdef USE_ESP32
|
4
4
|
|
5
5
|
#include <freertos/FreeRTOS.h>
|
6
|
-
#include <freertos/
|
6
|
+
#include <freertos/ringbuf.h>
|
7
7
|
|
8
8
|
#include <cinttypes>
|
9
9
|
#include <memory>
|
@@ -82,9 +82,14 @@ class RingBuffer {
|
|
82
82
|
static std::unique_ptr<RingBuffer> create(size_t len);
|
83
83
|
|
84
84
|
protected:
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
/// @brief Discards data from the ring buffer.
|
86
|
+
/// @param discard_bytes amount of bytes to discard
|
87
|
+
/// @return True if all bytes were successfully discarded, false otherwise
|
88
|
+
bool discard_bytes_(size_t discard_bytes);
|
89
|
+
|
90
|
+
RingbufHandle_t handle_{nullptr};
|
91
|
+
StaticRingbuffer_t structure_;
|
92
|
+
uint8_t *storage_{nullptr};
|
88
93
|
size_t size_{0};
|
89
94
|
};
|
90
95
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: esphome
|
3
|
-
Version: 2024.12.
|
3
|
+
Version: 2024.12.2
|
4
4
|
Summary: ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems.
|
5
5
|
Author-email: The ESPHome Authors <esphome@nabucasa.com>
|
6
6
|
License: MIT
|
@@ -5,7 +5,7 @@ esphome/codegen.py,sha256=GePHUM7xdXb_Pil59SHVsXg2F4VBPgkH-Fz2PDX8Z54,1873
|
|
5
5
|
esphome/config.py,sha256=nOiXPZv8wHtmytkNlGcewp0uuJd9G5rRjkqevYXtjzo,39618
|
6
6
|
esphome/config_helpers.py,sha256=MKf_wzO35nn41FvigXE0iYKDslPgL2ruf8R-EPtTT2I,3256
|
7
7
|
esphome/config_validation.py,sha256=jtqGmSF_0mAIMxRMV3eJj7dQ71Jmlc51NOx6AvWlnqs,66374
|
8
|
-
esphome/const.py,sha256=
|
8
|
+
esphome/const.py,sha256=zsCpMm6iTR-ecP1c0PGgr3jOgsTg7Wl7CdCtpBeUn9Q,40644
|
9
9
|
esphome/coroutine.py,sha256=j_14z8dIIzIBeuNO30D4c1RJvMMt1xZFZ58Evd-EvJA,9344
|
10
10
|
esphome/cpp_generator.py,sha256=lXPXHYUsFIvBSAoZ93mXYlGcXYg5L18nTtYGHE4_rr8,31203
|
11
11
|
esphome/cpp_helpers.py,sha256=6C2vNbOIhZKi43xRVlk5hp9GfshfBn-rc5D_ZFUEYaE,4801
|
@@ -771,7 +771,7 @@ esphome/components/es8311/audio_dac.py,sha256=aGpvvL4ftBaYMACjvL9RbGXi9iwEvuv97e
|
|
771
771
|
esphome/components/es8311/es8311.cpp,sha256=ueFDZsNbpY9w9us6MBa7nldqRFXc969wzGpjFIk7NyY,7029
|
772
772
|
esphome/components/es8311/es8311.h,sha256=XM3joN7HWuFu7Q1EGl7abfknRCyjpIs_KffM_oRM6eY,4680
|
773
773
|
esphome/components/es8311/es8311_const.h,sha256=bUBF4DJ28DcLPHznvh30Guewi65mSqQbqNPK0NiM8fI,12566
|
774
|
-
esphome/components/esp32/__init__.py,sha256=
|
774
|
+
esphome/components/esp32/__init__.py,sha256=aAtdODHppIY7cAR40_-oY_cHVPxYmQGWQjRW0Q-eDPM,30714
|
775
775
|
esphome/components/esp32/boards.py,sha256=BSabIM_DaDXFkPvGemv_3mcqFgEUt2lAnxN5EFpCO9U,52725
|
776
776
|
esphome/components/esp32/const.py,sha256=2yxLQg3p2-S3nRL6-zsF_dICrP_6waUfY5k8EFsoyVM,966
|
777
777
|
esphome/components/esp32/core.cpp,sha256=GfidaExP8kU7ODM1S_VI9c3tQtmG2TaKwLJ-zzeSqd4,2413
|
@@ -791,7 +791,7 @@ esphome/components/esp32/preferences.h,sha256=9HIy-BOgjOXJiEgOizZ_Qb8-l6K4eb3VSP
|
|
791
791
|
esphome/components/esp32_ble/__init__.py,sha256=_icbuq6fiRVExFZe1ETU2GJ6ziR4LxMK3nzeER7gEuY,4321
|
792
792
|
esphome/components/esp32_ble/ble.cpp,sha256=w51oEvWeMcYs2CgIlCLTFEMaxxzxW0hAstWhwHl_oQM,13661
|
793
793
|
esphome/components/esp32_ble/ble.h,sha256=1USMpwRwVHc6_CnxieJa55mMPq3GFfkEPPYarySc05Y,5234
|
794
|
-
esphome/components/esp32_ble/ble_advertising.cpp,sha256=
|
794
|
+
esphome/components/esp32_ble/ble_advertising.cpp,sha256=nWetDKFwcdhyaqRyq8KKmsFctLEF-4Bw81QPYHmxi24,6039
|
795
795
|
esphome/components/esp32_ble/ble_advertising.h,sha256=dLksw168KS1wh3_X7GhesS9nacINphlZUl4nMgYSA8M,1480
|
796
796
|
esphome/components/esp32_ble/ble_event.h,sha256=ED5C_SrTybqtu30vevlPr8NBsBUVKK6MSVC9UzwspHc,2771
|
797
797
|
esphome/components/esp32_ble/ble_uuid.cpp,sha256=2go_q78xgFlQRH_ZpM4tdsDJqyqe_3Ssn2PJFkpjlfI,6167
|
@@ -3355,8 +3355,8 @@ esphome/core/log.h,sha256=sMwmrs64vOG0G9jIibKJWv_C-COl175T8JymmBVRHWI,6369
|
|
3355
3355
|
esphome/core/macros.h,sha256=YRip3XYzXw2pg3AFpBFA0Js-Y5GMtPkuCp2km2g5uhc,196
|
3356
3356
|
esphome/core/optional.h,sha256=Di5V9YFV4vvMgVoORXe7Ojd3kLlBF7wTE4KeQGAaLSk,6968
|
3357
3357
|
esphome/core/preferences.h,sha256=RxgWuAi-uo6SZiK8UKX4KTwVfIMnaaLvrZP2rqTn_mE,1959
|
3358
|
-
esphome/core/ring_buffer.cpp,sha256=
|
3359
|
-
esphome/core/ring_buffer.h,sha256=
|
3358
|
+
esphome/core/ring_buffer.cpp,sha256=8lEn4WbgEU9Mbc1KrR2RLzjbcAA6xsyL9IjZ82-QmB8,3602
|
3359
|
+
esphome/core/ring_buffer.h,sha256=4SeN2DYZLCHrLIjSPDsiAynIjwOoItiRUDO-u1wjq-o,2997
|
3360
3360
|
esphome/core/scheduler.cpp,sha256=fH2E-e0jQ0nd90lojK5voee1lBY7rYzLWWjWZj6rbHA,12072
|
3361
3361
|
esphome/core/scheduler.h,sha256=OZaBsLlo2R2nJvYcq7LyUGPXLzLAJdMEmtBewWF_9Ps,2455
|
3362
3362
|
esphome/core/string_ref.cpp,sha256=of1TYMY6t3t4HjjPLSiItuPSa62AMG0lK_CU2HS1RvM,242
|
@@ -3385,9 +3385,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
|
|
3385
3385
|
esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
|
3386
3386
|
esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
|
3387
3387
|
esphome/dashboard/util/text.py,sha256=ENDnfN4O0NdA3CKVJjQYabFbwbrsIhVKrAMQe53qYu4,534
|
3388
|
-
esphome-2024.12.
|
3389
|
-
esphome-2024.12.
|
3390
|
-
esphome-2024.12.
|
3391
|
-
esphome-2024.12.
|
3392
|
-
esphome-2024.12.
|
3393
|
-
esphome-2024.12.
|
3388
|
+
esphome-2024.12.2.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
|
3389
|
+
esphome-2024.12.2.dist-info/METADATA,sha256=eQtknicx9P8tIqJpFlBiMRWt33Sb2OafTQi6_6HHie8,3549
|
3390
|
+
esphome-2024.12.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
3391
|
+
esphome-2024.12.2.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
|
3392
|
+
esphome-2024.12.2.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
|
3393
|
+
esphome-2024.12.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|