esphome 2025.5.1__py3-none-any.whl → 2025.5.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.
@@ -15,10 +15,6 @@ namespace debug {
15
15
  static const char *const TAG = "debug";
16
16
 
17
17
  void DebugComponent::dump_config() {
18
- #ifndef ESPHOME_LOG_HAS_DEBUG
19
- return; // Can't log below if debug logging is disabled
20
- #endif
21
-
22
18
  ESP_LOGCONFIG(TAG, "Debug component:");
23
19
  #ifdef USE_TEXT_SENSOR
24
20
  LOG_TEXT_SENSOR(" ", "Device info", this->device_info_);
@@ -40,6 +40,7 @@ struct ISRPinArg {
40
40
  volatile uint32_t *mode_set_reg;
41
41
  volatile uint32_t *mode_clr_reg;
42
42
  volatile uint32_t *func_reg;
43
+ volatile uint32_t *control_reg;
43
44
  uint32_t mask;
44
45
  };
45
46
 
@@ -54,6 +55,7 @@ ISRInternalGPIOPin ESP8266GPIOPin::to_isr() const {
54
55
  arg->mode_set_reg = &GPES;
55
56
  arg->mode_clr_reg = &GPEC;
56
57
  arg->func_reg = &GPF(this->pin_);
58
+ arg->control_reg = &GPC(this->pin_);
57
59
  arg->mask = 1 << this->pin_;
58
60
  } else {
59
61
  arg->in_reg = &GP16I;
@@ -62,6 +64,7 @@ ISRInternalGPIOPin ESP8266GPIOPin::to_isr() const {
62
64
  arg->mode_set_reg = &GP16E;
63
65
  arg->mode_clr_reg = nullptr;
64
66
  arg->func_reg = &GPF16;
67
+ arg->control_reg = nullptr;
65
68
  arg->mask = 1;
66
69
  }
67
70
  return ISRInternalGPIOPin((void *) arg);
@@ -143,11 +146,17 @@ void IRAM_ATTR ISRInternalGPIOPin::pin_mode(gpio::Flags flags) {
143
146
  if (arg->pin < 16) {
144
147
  if (flags & gpio::FLAG_OUTPUT) {
145
148
  *arg->mode_set_reg = arg->mask;
146
- } else {
149
+ if (flags & gpio::FLAG_OPEN_DRAIN) {
150
+ *arg->control_reg |= 1 << GPCD;
151
+ } else {
152
+ *arg->control_reg &= ~(1 << GPCD);
153
+ }
154
+ } else if (flags & gpio::FLAG_INPUT) {
147
155
  *arg->mode_clr_reg = arg->mask;
148
156
  }
149
157
  if (flags & gpio::FLAG_PULLUP) {
150
158
  *arg->func_reg |= 1 << GPFPU;
159
+ *arg->control_reg |= 1 << GPCD;
151
160
  } else {
152
161
  *arg->func_reg &= ~(1 << GPFPU);
153
162
  }
@@ -30,11 +30,11 @@ static const int32_t DC_OFFSET_MOVING_AVERAGE_COEFFICIENT_DENOMINATOR = 1000;
30
30
  static const char *const TAG = "i2s_audio.microphone";
31
31
 
32
32
  enum MicrophoneEventGroupBits : uint32_t {
33
- COMMAND_STOP = (1 << 0), // stops the microphone task
34
- TASK_STARTING = (1 << 10),
35
- TASK_RUNNING = (1 << 11),
36
- TASK_STOPPING = (1 << 12),
37
- TASK_STOPPED = (1 << 13),
33
+ COMMAND_STOP = (1 << 0), // stops the microphone task, set and cleared by ``loop``
34
+
35
+ TASK_STARTING = (1 << 10), // set by mic task, cleared by ``loop``
36
+ TASK_RUNNING = (1 << 11), // set by mic task, cleared by ``loop``
37
+ TASK_STOPPED = (1 << 13), // set by mic task, cleared by ``loop``
38
38
 
39
39
  ALL_BITS = 0x00FFFFFF, // All valid FreeRTOS event group bits
40
40
  };
@@ -151,24 +151,21 @@ bool I2SAudioMicrophone::start_driver_() {
151
151
  config.mode = (i2s_mode_t) (config.mode | I2S_MODE_ADC_BUILT_IN);
152
152
  err = i2s_driver_install(this->parent_->get_port(), &config, 0, nullptr);
153
153
  if (err != ESP_OK) {
154
- ESP_LOGW(TAG, "Error installing I2S driver: %s", esp_err_to_name(err));
155
- this->status_set_error();
154
+ ESP_LOGE(TAG, "Error installing I2S driver: %s", esp_err_to_name(err));
156
155
  return false;
157
156
  }
158
157
 
159
158
  err = i2s_set_adc_mode(ADC_UNIT_1, this->adc_channel_);
160
159
  if (err != ESP_OK) {
161
- ESP_LOGW(TAG, "Error setting ADC mode: %s", esp_err_to_name(err));
162
- this->status_set_error();
160
+ ESP_LOGE(TAG, "Error setting ADC mode: %s", esp_err_to_name(err));
163
161
  return false;
164
162
  }
163
+
165
164
  err = i2s_adc_enable(this->parent_->get_port());
166
165
  if (err != ESP_OK) {
167
- ESP_LOGW(TAG, "Error enabling ADC: %s", esp_err_to_name(err));
168
- this->status_set_error();
166
+ ESP_LOGE(TAG, "Error enabling ADC: %s", esp_err_to_name(err));
169
167
  return false;
170
168
  }
171
-
172
169
  } else
173
170
  #endif
174
171
  {
@@ -177,8 +174,7 @@ bool I2SAudioMicrophone::start_driver_() {
177
174
 
178
175
  err = i2s_driver_install(this->parent_->get_port(), &config, 0, nullptr);
179
176
  if (err != ESP_OK) {
180
- ESP_LOGW(TAG, "Error installing I2S driver: %s", esp_err_to_name(err));
181
- this->status_set_error();
177
+ ESP_LOGE(TAG, "Error installing I2S driver: %s", esp_err_to_name(err));
182
178
  return false;
183
179
  }
184
180
 
@@ -187,8 +183,7 @@ bool I2SAudioMicrophone::start_driver_() {
187
183
 
188
184
  err = i2s_set_pin(this->parent_->get_port(), &pin_config);
189
185
  if (err != ESP_OK) {
190
- ESP_LOGW(TAG, "Error setting I2S pin: %s", esp_err_to_name(err));
191
- this->status_set_error();
186
+ ESP_LOGE(TAG, "Error setting I2S pin: %s", esp_err_to_name(err));
192
187
  return false;
193
188
  }
194
189
  }
@@ -203,8 +198,7 @@ bool I2SAudioMicrophone::start_driver_() {
203
198
  /* Allocate a new RX channel and get the handle of this channel */
204
199
  err = i2s_new_channel(&chan_cfg, NULL, &this->rx_handle_);
205
200
  if (err != ESP_OK) {
206
- ESP_LOGW(TAG, "Error creating new I2S channel: %s", esp_err_to_name(err));
207
- this->status_set_error();
201
+ ESP_LOGE(TAG, "Error creating new I2S channel: %s", esp_err_to_name(err));
208
202
  return false;
209
203
  }
210
204
 
@@ -276,22 +270,20 @@ bool I2SAudioMicrophone::start_driver_() {
276
270
  err = i2s_channel_init_std_mode(this->rx_handle_, &std_cfg);
277
271
  }
278
272
  if (err != ESP_OK) {
279
- ESP_LOGW(TAG, "Error initializing I2S channel: %s", esp_err_to_name(err));
280
- this->status_set_error();
273
+ ESP_LOGE(TAG, "Error initializing I2S channel: %s", esp_err_to_name(err));
281
274
  return false;
282
275
  }
283
276
 
284
277
  /* Before reading data, start the RX channel first */
285
278
  i2s_channel_enable(this->rx_handle_);
286
279
  if (err != ESP_OK) {
287
- ESP_LOGW(TAG, "Error enabling I2S Microphone: %s", esp_err_to_name(err));
288
- this->status_set_error();
280
+ ESP_LOGE(TAG, "Error enabling I2S Microphone: %s", esp_err_to_name(err));
289
281
  return false;
290
282
  }
291
283
  #endif
292
284
 
293
- this->status_clear_error();
294
285
  this->configure_stream_settings_(); // redetermine the settings in case some settings were changed after compilation
286
+
295
287
  return true;
296
288
  }
297
289
 
@@ -303,71 +295,55 @@ void I2SAudioMicrophone::stop() {
303
295
  }
304
296
 
305
297
  void I2SAudioMicrophone::stop_driver_() {
298
+ // There is no harm continuing to unload the driver if an error is ever returned by the various functions. This
299
+ // ensures that we stop/unload the driver when it only partially starts.
300
+
306
301
  esp_err_t err;
307
302
  #ifdef USE_I2S_LEGACY
308
303
  #if SOC_I2S_SUPPORTS_ADC
309
304
  if (this->adc_) {
310
305
  err = i2s_adc_disable(this->parent_->get_port());
311
306
  if (err != ESP_OK) {
312
- ESP_LOGW(TAG, "Error disabling ADC: %s", esp_err_to_name(err));
313
- this->status_set_error();
314
- return;
307
+ ESP_LOGW(TAG, "Error disabling ADC - it may not have started: %s", esp_err_to_name(err));
315
308
  }
316
309
  }
317
310
  #endif
318
311
  err = i2s_stop(this->parent_->get_port());
319
312
  if (err != ESP_OK) {
320
- ESP_LOGW(TAG, "Error stopping I2S microphone: %s", esp_err_to_name(err));
321
- this->status_set_error();
322
- return;
313
+ ESP_LOGW(TAG, "Error stopping I2S microphone - it may not have started: %s", esp_err_to_name(err));
323
314
  }
324
315
  err = i2s_driver_uninstall(this->parent_->get_port());
325
316
  if (err != ESP_OK) {
326
- ESP_LOGW(TAG, "Error uninstalling I2S driver: %s", esp_err_to_name(err));
327
- this->status_set_error();
328
- return;
317
+ ESP_LOGW(TAG, "Error uninstalling I2S driver - it may not have started: %s", esp_err_to_name(err));
329
318
  }
330
319
  #else
331
320
  /* Have to stop the channel before deleting it */
332
321
  err = i2s_channel_disable(this->rx_handle_);
333
322
  if (err != ESP_OK) {
334
- ESP_LOGW(TAG, "Error stopping I2S microphone: %s", esp_err_to_name(err));
335
- this->status_set_error();
336
- return;
323
+ ESP_LOGW(TAG, "Error stopping I2S microphone - it may not have started: %s", esp_err_to_name(err));
337
324
  }
338
325
  /* If the handle is not needed any more, delete it to release the channel resources */
339
326
  err = i2s_del_channel(this->rx_handle_);
340
327
  if (err != ESP_OK) {
341
- ESP_LOGW(TAG, "Error deleting I2S channel: %s", esp_err_to_name(err));
342
- this->status_set_error();
343
- return;
328
+ ESP_LOGW(TAG, "Error deleting I2S channel - it may not have started: %s", esp_err_to_name(err));
344
329
  }
345
330
  #endif
346
331
  this->parent_->unlock();
347
- this->status_clear_error();
348
332
  }
349
333
 
350
334
  void I2SAudioMicrophone::mic_task(void *params) {
351
335
  I2SAudioMicrophone *this_microphone = (I2SAudioMicrophone *) params;
352
-
353
336
  xEventGroupSetBits(this_microphone->event_group_, MicrophoneEventGroupBits::TASK_STARTING);
354
337
 
355
- uint8_t start_counter = 0;
356
- bool started = this_microphone->start_driver_();
357
- while (!started && start_counter < 10) {
358
- // Attempt to load the driver again in 100 ms. Doesn't slow down main loop since its in a task.
359
- vTaskDelay(pdMS_TO_TICKS(100));
360
- ++start_counter;
361
- started = this_microphone->start_driver_();
362
- }
338
+ { // Ensures the samples vector is freed when the task stops
363
339
 
364
- if (started) {
365
- xEventGroupSetBits(this_microphone->event_group_, MicrophoneEventGroupBits::TASK_RUNNING);
366
340
  const size_t bytes_to_read = this_microphone->audio_stream_info_.ms_to_bytes(READ_DURATION_MS);
367
341
  std::vector<uint8_t> samples;
368
342
  samples.reserve(bytes_to_read);
369
343
 
370
- while (!(xEventGroupGetBits(this_microphone->event_group_) & COMMAND_STOP)) {
344
+ xEventGroupSetBits(this_microphone->event_group_, MicrophoneEventGroupBits::TASK_RUNNING);
345
+
346
+ while (!(xEventGroupGetBits(this_microphone->event_group_) & MicrophoneEventGroupBits::COMMAND_STOP)) {
371
347
  if (this_microphone->data_callbacks_.size() > 0) {
372
348
  samples.resize(bytes_to_read);
373
349
  size_t bytes_read = this_microphone->read_(samples.data(), bytes_to_read, 2 * pdMS_TO_TICKS(READ_DURATION_MS));
@@ -382,9 +358,6 @@ void I2SAudioMicrophone::mic_task(void *params) {
382
358
  }
383
359
  }
384
360
 
385
- xEventGroupSetBits(this_microphone->event_group_, MicrophoneEventGroupBits::TASK_STOPPING);
386
- this_microphone->stop_driver_();
387
-
388
361
  xEventGroupSetBits(this_microphone->event_group_, MicrophoneEventGroupBits::TASK_STOPPED);
389
362
  while (true) {
390
363
  // Continuously delay until the loop method deletes the task
@@ -425,7 +398,10 @@ size_t I2SAudioMicrophone::read_(uint8_t *buf, size_t len, TickType_t ticks_to_w
425
398
  #endif
426
399
  if ((err != ESP_OK) && ((err != ESP_ERR_TIMEOUT) || (ticks_to_wait != 0))) {
427
400
  // Ignore ESP_ERR_TIMEOUT if ticks_to_wait = 0, as it will read the data on the next call
428
- ESP_LOGW(TAG, "Error reading from I2S microphone: %s", esp_err_to_name(err));
401
+ if (!this->status_has_warning()) {
402
+ // Avoid spamming the logs with the error message if its repeated
403
+ ESP_LOGW(TAG, "Error reading from I2S microphone: %s", esp_err_to_name(err));
404
+ }
429
405
  this->status_set_warning();
430
406
  return 0;
431
407
  }
@@ -452,7 +428,7 @@ void I2SAudioMicrophone::loop() {
452
428
  uint32_t event_group_bits = xEventGroupGetBits(this->event_group_);
453
429
 
454
430
  if (event_group_bits & MicrophoneEventGroupBits::TASK_STARTING) {
455
- ESP_LOGD(TAG, "Task has started, attempting to setup I2S audio driver");
431
+ ESP_LOGD(TAG, "Task started, attempting to allocate buffer");
456
432
  xEventGroupClearBits(this->event_group_, MicrophoneEventGroupBits::TASK_STARTING);
457
433
  }
458
434
 
@@ -463,23 +439,25 @@ void I2SAudioMicrophone::loop() {
463
439
  this->state_ = microphone::STATE_RUNNING;
464
440
  }
465
441
 
466
- if (event_group_bits & MicrophoneEventGroupBits::TASK_STOPPING) {
467
- ESP_LOGD(TAG, "Task is stopping, attempting to unload the I2S audio driver");
468
- xEventGroupClearBits(this->event_group_, MicrophoneEventGroupBits::TASK_STOPPING);
469
- }
470
-
471
442
  if ((event_group_bits & MicrophoneEventGroupBits::TASK_STOPPED)) {
472
- ESP_LOGD(TAG, "Task is finished, freeing resources");
443
+ ESP_LOGD(TAG, "Task finished, freeing resources and uninstalling I2S driver");
444
+
473
445
  vTaskDelete(this->task_handle_);
474
446
  this->task_handle_ = nullptr;
447
+ this->stop_driver_();
475
448
  xEventGroupClearBits(this->event_group_, ALL_BITS);
449
+ this->status_clear_error();
450
+
476
451
  this->state_ = microphone::STATE_STOPPED;
477
452
  }
478
453
 
454
+ // Start the microphone if any semaphores are taken
479
455
  if ((uxSemaphoreGetCount(this->active_listeners_semaphore_) < MAX_LISTENERS) &&
480
456
  (this->state_ == microphone::STATE_STOPPED)) {
481
457
  this->state_ = microphone::STATE_STARTING;
482
458
  }
459
+
460
+ // Stop the microphone if all semaphores are returned
483
461
  if ((uxSemaphoreGetCount(this->active_listeners_semaphore_) == MAX_LISTENERS) &&
484
462
  (this->state_ == microphone::STATE_RUNNING)) {
485
463
  this->state_ = microphone::STATE_STOPPING;
@@ -487,14 +465,26 @@ void I2SAudioMicrophone::loop() {
487
465
 
488
466
  switch (this->state_) {
489
467
  case microphone::STATE_STARTING:
490
- if ((this->task_handle_ == nullptr) && !this->status_has_error()) {
468
+ if (this->status_has_error()) {
469
+ break;
470
+ }
471
+
472
+ if (!this->start_driver_()) {
473
+ this->status_momentary_error("I2S driver failed to start, unloading it and attempting again in 1 second", 1000);
474
+ this->stop_driver_(); // Stop/frees whatever possibly started
475
+ break;
476
+ }
477
+
478
+ if (this->task_handle_ == nullptr) {
491
479
  xTaskCreate(I2SAudioMicrophone::mic_task, "mic_task", TASK_STACK_SIZE, (void *) this, TASK_PRIORITY,
492
480
  &this->task_handle_);
493
481
 
494
482
  if (this->task_handle_ == nullptr) {
495
483
  this->status_momentary_error("Task failed to start, attempting again in 1 second", 1000);
484
+ this->stop_driver_(); // Stops the driver to return the lock; will be reloaded in next attempt
496
485
  }
497
486
  }
487
+
498
488
  break;
499
489
  case microphone::STATE_RUNNING:
500
490
  break;
@@ -43,7 +43,11 @@ class I2SAudioMicrophone : public I2SAudioIn, public microphone::Microphone, pub
43
43
  #endif
44
44
 
45
45
  protected:
46
+ /// @brief Starts the I2S driver. Updates the ``audio_stream_info_`` member variable with the current setttings.
47
+ /// @return True if succesful, false otherwise
46
48
  bool start_driver_();
49
+
50
+ /// @brief Stops the I2S driver.
47
51
  void stop_driver_();
48
52
 
49
53
  /// @brief Attempts to correct a microphone DC offset; e.g., a microphones silent level is offset from 0. Applies a
@@ -212,9 +212,9 @@ class Logger : public Component {
212
212
  }
213
213
 
214
214
  // Format string to explicit buffer with varargs
215
- inline void printf_to_buffer_(const char *format, char *buffer, int *buffer_at, int buffer_size, ...) {
215
+ inline void printf_to_buffer_(char *buffer, int *buffer_at, int buffer_size, const char *format, ...) {
216
216
  va_list arg;
217
- va_start(arg, buffer_size);
217
+ va_start(arg, format);
218
218
  this->format_body_to_buffer_(buffer, buffer_at, buffer_size, format, arg);
219
219
  va_end(arg);
220
220
  }
@@ -312,13 +312,13 @@ class Logger : public Component {
312
312
  #if defined(USE_ESP32) || defined(USE_LIBRETINY)
313
313
  if (thread_name != nullptr) {
314
314
  // Non-main task with thread name
315
- this->printf_to_buffer_("%s[%s][%s:%03u]%s[%s]%s: ", buffer, buffer_at, buffer_size, color, letter, tag, line,
315
+ this->printf_to_buffer_(buffer, buffer_at, buffer_size, "%s[%s][%s:%03u]%s[%s]%s: ", color, letter, tag, line,
316
316
  ESPHOME_LOG_BOLD(ESPHOME_LOG_COLOR_RED), thread_name, color);
317
317
  return;
318
318
  }
319
319
  #endif
320
320
  // Main task or non ESP32/LibreTiny platform
321
- this->printf_to_buffer_("%s[%s][%s:%03u]: ", buffer, buffer_at, buffer_size, color, letter, tag, line);
321
+ this->printf_to_buffer_(buffer, buffer_at, buffer_size, "%s[%s][%s:%03u]: ", color, letter, tag, line);
322
322
  }
323
323
 
324
324
  inline void HOT format_body_to_buffer_(char *buffer, int *buffer_at, int buffer_size, const char *format,
@@ -8,7 +8,7 @@ namespace rp2040 {
8
8
 
9
9
  static const char *const TAG = "rp2040";
10
10
 
11
- static int IRAM_ATTR flags_to_mode(gpio::Flags flags, uint8_t pin) {
11
+ static int flags_to_mode(gpio::Flags flags, uint8_t pin) {
12
12
  if (flags == gpio::FLAG_INPUT) { // NOLINT(bugprone-branch-clone)
13
13
  return INPUT;
14
14
  } else if (flags == gpio::FLAG_OUTPUT) {
@@ -25,14 +25,16 @@ static int IRAM_ATTR flags_to_mode(gpio::Flags flags, uint8_t pin) {
25
25
  }
26
26
 
27
27
  struct ISRPinArg {
28
+ uint32_t mask;
28
29
  uint8_t pin;
29
30
  bool inverted;
30
31
  };
31
32
 
32
33
  ISRInternalGPIOPin RP2040GPIOPin::to_isr() const {
33
34
  auto *arg = new ISRPinArg{}; // NOLINT(cppcoreguidelines-owning-memory)
34
- arg->pin = pin_;
35
- arg->inverted = inverted_;
35
+ arg->pin = this->pin_;
36
+ arg->inverted = this->inverted_;
37
+ arg->mask = 1 << this->pin_;
36
38
  return ISRInternalGPIOPin((void *) arg);
37
39
  }
38
40
 
@@ -81,21 +83,36 @@ void RP2040GPIOPin::detach_interrupt() const { detachInterrupt(pin_); }
81
83
  using namespace rp2040;
82
84
 
83
85
  bool IRAM_ATTR ISRInternalGPIOPin::digital_read() {
84
- auto *arg = reinterpret_cast<ISRPinArg *>(arg_);
85
- return bool(digitalRead(arg->pin)) != arg->inverted; // NOLINT
86
+ auto *arg = reinterpret_cast<ISRPinArg *>(this->arg_);
87
+ return bool(sio_hw->gpio_in & arg->mask) != arg->inverted;
86
88
  }
89
+
87
90
  void IRAM_ATTR ISRInternalGPIOPin::digital_write(bool value) {
88
- auto *arg = reinterpret_cast<ISRPinArg *>(arg_);
89
- digitalWrite(arg->pin, value != arg->inverted ? 1 : 0); // NOLINT
91
+ auto *arg = reinterpret_cast<ISRPinArg *>(this->arg_);
92
+ if (value != arg->inverted) {
93
+ sio_hw->gpio_set = arg->mask;
94
+ } else {
95
+ sio_hw->gpio_clr = arg->mask;
96
+ }
90
97
  }
98
+
91
99
  void IRAM_ATTR ISRInternalGPIOPin::clear_interrupt() {
92
100
  // TODO: implement
93
101
  // auto *arg = reinterpret_cast<ISRPinArg *>(arg_);
94
102
  // GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, 1UL << arg->pin);
95
103
  }
104
+
96
105
  void IRAM_ATTR ISRInternalGPIOPin::pin_mode(gpio::Flags flags) {
97
- auto *arg = reinterpret_cast<ISRPinArg *>(arg_);
98
- pinMode(arg->pin, flags_to_mode(flags, arg->pin)); // NOLINT
106
+ auto *arg = reinterpret_cast<ISRPinArg *>(this->arg_);
107
+ if (flags & gpio::FLAG_OUTPUT) {
108
+ sio_hw->gpio_oe_set = arg->mask;
109
+ } else if (flags & gpio::FLAG_INPUT) {
110
+ sio_hw->gpio_oe_clr = arg->mask;
111
+ hw_write_masked(&padsbank0_hw->io[arg->pin],
112
+ (bool_to_bit(flags & gpio::FLAG_PULLUP) << PADS_BANK0_GPIO0_PUE_LSB) |
113
+ (bool_to_bit(flags & gpio::FLAG_PULLDOWN) << PADS_BANK0_GPIO0_PDE_LSB),
114
+ PADS_BANK0_GPIO0_PUE_BITS | PADS_BANK0_GPIO0_PDE_BITS);
115
+ }
99
116
  }
100
117
 
101
118
  } // namespace esphome
esphome/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants used by esphome."""
2
2
 
3
- __version__ = "2025.5.1"
3
+ __version__ = "2025.5.2"
4
4
 
5
5
  ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
6
6
  VALID_SUBSTITUTIONS_CHARACTERS = (
esphome/core/hal.h CHANGED
@@ -24,6 +24,11 @@
24
24
  #define PROGMEM ICACHE_RODATA_ATTR
25
25
  #endif
26
26
 
27
+ #elif defined(USE_RP2040)
28
+
29
+ #define IRAM_ATTR __attribute__((noinline, long_call, section(".time_critical")))
30
+ #define PROGMEM
31
+
27
32
  #else
28
33
 
29
34
  #define IRAM_ATTR
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esphome
3
- Version: 2025.5.1
3
+ Version: 2025.5.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@openhomefoundation.org>
6
6
  License: MIT
@@ -5,7 +5,7 @@ esphome/codegen.py,sha256=GePHUM7xdXb_Pil59SHVsXg2F4VBPgkH-Fz2PDX8Z54,1873
5
5
  esphome/config.py,sha256=-SoMrYNlKL85sYK_t_UQXKEKm-xrZYhyRqwiUpBXyXE,39896
6
6
  esphome/config_helpers.py,sha256=MKf_wzO35nn41FvigXE0iYKDslPgL2ruf8R-EPtTT2I,3256
7
7
  esphome/config_validation.py,sha256=vEDw3u5jfyZbELimFLjTK5YuupBwKI8Np8HUo7oqpoo,61434
8
- esphome/const.py,sha256=aaeYPUtcOBNoZIeBpzK2voqOgBCVyz1j2PGgRWEzHR0,41480
8
+ esphome/const.py,sha256=nNM-1r_zEencdJk5_U17zc8N4Squb0F_Zo3FLL6g32U,41480
9
9
  esphome/coroutine.py,sha256=j_14z8dIIzIBeuNO30D4c1RJvMMt1xZFZ58Evd-EvJA,9344
10
10
  esphome/cpp_generator.py,sha256=39sLZ_f7UKrTOKKG5PVNQ6ucSRJFP0FYEhDN82DCO6Y,31377
11
11
  esphome/cpp_helpers.py,sha256=6C2vNbOIhZKi43xRVlk5hp9GfshfBn-rc5D_ZFUEYaE,4801
@@ -644,7 +644,7 @@ esphome/components/datetime/datetime_entity.h,sha256=qN4CuohdTVq5g0VKrl8whUE1FjF
644
644
  esphome/components/datetime/time_entity.cpp,sha256=k9ZEtOs4SIO3GCwc-SmKExwYiiyDDqra5Lxw6b7fW2M,4403
645
645
  esphome/components/datetime/time_entity.h,sha256=rNN9V8UH4ervs03lsuvR233dD13LYceAy597vXbURcY,2915
646
646
  esphome/components/debug/__init__.py,sha256=llo39yz0GH4Lo10IIVJfwna6okFO4g4-L0D1dStlK5U,1463
647
- esphome/components/debug/debug_component.cpp,sha256=KHrSIDf_fldO_UVdU1KbQNAmOMFc5Mp6GLki5nmvfp0,3130
647
+ esphome/components/debug/debug_component.cpp,sha256=aW9jdJpsVBkPbAEyrRZJwKo_8hoAsGwUyazwikdinGs,3033
648
648
  esphome/components/debug/debug_component.h,sha256=rhAbHVHngj9rtH33UDJ8Yg1CkxyS8iHlRAkDcvXqBcQ,3088
649
649
  esphome/components/debug/debug_esp32.cpp,sha256=X3-yqAeneoLn5feAgnjxLhtFgm70QdTEY9QL7d-YhjY,7004
650
650
  esphome/components/debug/debug_esp8266.cpp,sha256=eTj_cCcsHgG5YgtryxZFmM1bN2mHRXLEC1qPkfBDdDY,3145
@@ -886,7 +886,7 @@ esphome/components/esp8266/boards.py,sha256=p2btoDa36gfr9QsCOBZuME7Pi20Xf2LcQ_F-
886
886
  esphome/components/esp8266/const.py,sha256=bBUPq-_hzl36vVhKwCxCI_2TSNLJZpwbs6MtgHLVATI,380
887
887
  esphome/components/esp8266/core.cpp,sha256=IMhgyjd1a5Jm0j1wsUKcv6eme8A4_IdFdvPjX0QXNzE,2673
888
888
  esphome/components/esp8266/core.h,sha256=Gt8v8q9LxxHbKjf445vOk1iYXnRYCl4VogI7sdUQuMM,287
889
- esphome/components/esp8266/gpio.cpp,sha256=owUsfvd_eKiUn_cDLdHhP0F03kHvVnfuYfnsN8loJ2Y,4662
889
+ esphome/components/esp8266/gpio.cpp,sha256=EEpDKxujguHbdMuCe9TtFAChmi6se8-Etumf6EkpuEI,4986
890
890
  esphome/components/esp8266/gpio.h,sha256=drRteE3plCa62g9xm25cXu1CngCh-SQh2eNduCRuJCs,1060
891
891
  esphome/components/esp8266/gpio.py,sha256=A2vOhpFK2674x2OJ8Ruy_c-Xfe2CWPVy2N3c4OBGYk4,6368
892
892
  esphome/components/esp8266/post_build.py.script,sha256=Hca2nrttn2jdYmFVnNxsgMNlEFk2pg8GKMB6CTppR_k,703
@@ -1238,8 +1238,8 @@ esphome/components/i2s_audio/media_player/__init__.py,sha256=Is8GpC8A6eTDCdNCes3
1238
1238
  esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp,sha256=OlvkjzYSdaxIjJiQF-BbjThoY91_rvGJ4woRjyB9mwY,7538
1239
1239
  esphome/components/i2s_audio/media_player/i2s_audio_media_player.h,sha256=gmG6n9YU2Mz85CFa3fO7Na2KBdt9fOrGbDg0-C7jwjI,2078
1240
1240
  esphome/components/i2s_audio/microphone/__init__.py,sha256=m62jL72XwxBavk9cDULs2cdcbHHkM96JF5RPiPBHGcg,4281
1241
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp,sha256=Ak__GS9y0Ev0a6KLDuJgRoyOwdhGFJ7Um6BwcdEhI-k,16662
1242
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.h,sha256=E6MTRHS4tGu5DGXCnilTW5-kj-2b8gAMI5RfOwNESaM,2148
1241
+ esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp,sha256=yQ5b_bVg-2zNqfdunJL_8eeEzE97llg-JZV_DkgwNQM,16648
1242
+ esphome/components/i2s_audio/microphone/i2s_audio_microphone.h,sha256=QefL91wL9KHO6pN5DCxbrYNV1KsYGmR9cG8CosUe0pY,2348
1243
1243
  esphome/components/i2s_audio/speaker/__init__.py,sha256=EUWTtCtc3T5zoaHMUnqu-KjJh5nnwKrkUAQi3QYEDi0,6152
1244
1244
  esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp,sha256=vgdKk-CdPC4IuspdcJpypSv5L49fiqZ3ZtjKfTz4dmI,26865
1245
1245
  esphome/components/i2s_audio/speaker/i2s_audio_speaker.h,sha256=VqfZH3A4ZgqeXuhJuiBhGsERKthxF4eJB1HCYDBvU0s,6666
@@ -1500,7 +1500,7 @@ esphome/components/lock/lock.cpp,sha256=IyEt5xShAxMpmcn_GAPFv2lRCS-kr4MjjfExxfXu
1500
1500
  esphome/components/lock/lock.h,sha256=kFFccTAu56e6PhZVATW0NznOj0M7VByEn9gc6l5M3eA,6042
1501
1501
  esphome/components/logger/__init__.py,sha256=OOKS7yGtVaqIBoA0Y36mwNlK2H8182uDdy4cGPZwajA,14822
1502
1502
  esphome/components/logger/logger.cpp,sha256=9dxWxuHgWpwMiD27CuQgXbkGMiC3Uc84iglwj67OSP0,10485
1503
- esphome/components/logger/logger.h,sha256=73V1H5FoZCpFmVUGlNG2FNev4Zgp7F9tFBhnOKdMrD8,13021
1503
+ esphome/components/logger/logger.h,sha256=653__PTXxyfs2_vR4QK0feZhYXPPMxsmP4DYz-Vz-lE,13016
1504
1504
  esphome/components/logger/logger_esp32.cpp,sha256=SOLN5oHiVbnItxw4wdhvNdeunwgY7FR5j752fEt9__M,6101
1505
1505
  esphome/components/logger/logger_esp8266.cpp,sha256=k7GvUlcLxXCVYqBw7tlHRikmRe7hdO6qV837wr4N2ww,1182
1506
1506
  esphome/components/logger/logger_host.cpp,sha256=h3Its8pHiVvnyOc6rj5zRiug8rLi42f5QTQiTbBiCNo,450
@@ -2442,7 +2442,7 @@ esphome/components/rp2040/build_pio.py.script,sha256=aNtrSnjYcLY6t0NYBGszhwMPISV
2442
2442
  esphome/components/rp2040/const.py,sha256=1x4XQlMfgQux1bllBAhz9ym-aUeFglxtPnQbpG3vUYQ,147
2443
2443
  esphome/components/rp2040/core.cpp,sha256=hGPbOW4w5O3r04isZeAZtL2zWbe-sNf0TV7_7u1Sgzo,937
2444
2444
  esphome/components/rp2040/core.h,sha256=YA4WtdKTdnZxkpOUF4GwT3KMjsbFjH6j0y42EvetLFA,239
2445
- esphome/components/rp2040/gpio.cpp,sha256=_EkccW4ZuUW7HVJxaVgCqYA4z0h4MDf0SGLDYD7jW-M,3002
2445
+ esphome/components/rp2040/gpio.cpp,sha256=8aewN0-fqru1W7zj_g6hnhh9gjMKOIMamGIzSZkbozU,3516
2446
2446
  esphome/components/rp2040/gpio.h,sha256=xIaLyJ0GLs2uNVxnYXweixWDW0nZ5bHmGCdCWQI55tA,1055
2447
2447
  esphome/components/rp2040/gpio.py,sha256=HTZYi8manLRjLcEOwwSd7tTTEKa7btRco-gYQYudN7I,2913
2448
2448
  esphome/components/rp2040/post_build.py.script,sha256=JgNm6aGGA9LYGZEjzqr8EHiugKLU6h7fmmXFAhdBleI,699
@@ -3503,7 +3503,7 @@ esphome/core/entity_base.cpp,sha256=uh9DdAAkCxmVVhelBtqkiGW4_P9gDcZMBuwFDSIEqEQ,
3503
3503
  esphome/core/entity_base.h,sha256=y9pPjHUxtiadpSzUroBp8-YomztwZnzPVS6GF33YI3U,2831
3504
3504
  esphome/core/entity_helpers.py,sha256=s5lYCG5hu_1SROtSWgzI0T6802l5-I8udGy1_6HNSdc,2337
3505
3505
  esphome/core/gpio.h,sha256=kLkCnPxu4_1CsLR4BI_Baj1lDGoRIh8uubbwsIkJPIA,2575
3506
- esphome/core/hal.h,sha256=e3qFkax3jfncEusf3kwXCts0Ai7D4XspJgh-VqVDcK4,844
3506
+ esphome/core/hal.h,sha256=Le0-vtdDylYCaE9i4yvrv5-Y5PB5xoL3PM2FfMJsIeA,970
3507
3507
  esphome/core/helpers.cpp,sha256=jdQr3nSMOj6bIFColDaxMa3_BsyL4gHi0FzeXNY5-rw,25140
3508
3508
  esphome/core/helpers.h,sha256=qGssN0aPZbEyt8PrqZ-I8bd_N7RuBN4KhzM-qdkagPA,30317
3509
3509
  esphome/core/log.cpp,sha256=MDCx87ytW6Fz6basxYUpagkubFzUKO1ysvU5RXbXoII,1581
@@ -3541,9 +3541,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
3541
3541
  esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
3542
3542
  esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
3543
3543
  esphome/dashboard/util/text.py,sha256=ENDnfN4O0NdA3CKVJjQYabFbwbrsIhVKrAMQe53qYu4,534
3544
- esphome-2025.5.1.dist-info/licenses/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3545
- esphome-2025.5.1.dist-info/METADATA,sha256=GX_xJDGoIHf3pu64vKzwCTcKXeX8Z-0Oit_cUOKauiA,3624
3546
- esphome-2025.5.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
3547
- esphome-2025.5.1.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3548
- esphome-2025.5.1.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3549
- esphome-2025.5.1.dist-info/RECORD,,
3544
+ esphome-2025.5.2.dist-info/licenses/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3545
+ esphome-2025.5.2.dist-info/METADATA,sha256=t1I9qsH4YynvZFulQpJoHcLWUuWE8JLyjxVekPJz_sQ,3624
3546
+ esphome-2025.5.2.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
3547
+ esphome-2025.5.2.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3548
+ esphome-2025.5.2.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3549
+ esphome-2025.5.2.dist-info/RECORD,,