esphome 2024.8.0b3__py3-none-any.whl → 2024.8.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.
@@ -172,6 +172,19 @@ def add_idf_component(
172
172
  KEY_COMPONENTS: components,
173
173
  KEY_SUBMODULES: submodules,
174
174
  }
175
+ else:
176
+ component_config = CORE.data[KEY_ESP32][KEY_COMPONENTS][name]
177
+ if components is not None:
178
+ component_config[KEY_COMPONENTS] = list(
179
+ set(component_config[KEY_COMPONENTS] + components)
180
+ )
181
+ if submodules is not None:
182
+ if component_config[KEY_SUBMODULES] is None:
183
+ component_config[KEY_SUBMODULES] = submodules
184
+ else:
185
+ component_config[KEY_SUBMODULES] = list(
186
+ set(component_config[KEY_SUBMODULES] + submodules)
187
+ )
175
188
 
176
189
 
177
190
  def add_extra_script(stage: str, filename: str, path: str):
@@ -7,8 +7,10 @@
7
7
 
8
8
  #include <hardware/clocks.h>
9
9
  #include <hardware/dma.h>
10
+ #include <hardware/irq.h>
10
11
  #include <hardware/pio.h>
11
12
  #include <pico/stdlib.h>
13
+ #include <pico/sem.h>
12
14
 
13
15
  namespace esphome {
14
16
  namespace rp2040_pio_led_strip {
@@ -23,6 +25,19 @@ static std::map<Chipset, bool> conf_count_ = {
23
25
  {CHIPSET_WS2812, false}, {CHIPSET_WS2812B, false}, {CHIPSET_SK6812, false},
24
26
  {CHIPSET_SM16703, false}, {CHIPSET_CUSTOM, false},
25
27
  };
28
+ static bool dma_chan_active_[12];
29
+ static struct semaphore dma_write_complete_sem_[12];
30
+
31
+ // DMA interrupt service routine
32
+ void RP2040PIOLEDStripLightOutput::dma_write_complete_handler_() {
33
+ uint32_t channel = dma_hw->ints0;
34
+ for (uint dma_chan = 0; dma_chan < 12; ++dma_chan) {
35
+ if (RP2040PIOLEDStripLightOutput::dma_chan_active_[dma_chan] && (channel & (1u << dma_chan))) {
36
+ dma_hw->ints0 = (1u << dma_chan); // Clear the interrupt
37
+ sem_release(&RP2040PIOLEDStripLightOutput::dma_write_complete_sem_[dma_chan]); // Handle the interrupt
38
+ }
39
+ }
40
+ }
26
41
 
27
42
  void RP2040PIOLEDStripLightOutput::setup() {
28
43
  ESP_LOGCONFIG(TAG, "Setting up RP2040 LED Strip...");
@@ -57,22 +72,22 @@ void RP2040PIOLEDStripLightOutput::setup() {
57
72
  // but there are only 4 state machines on each PIO so we can only have 4 strips per PIO
58
73
  uint offset = 0;
59
74
 
60
- if (num_instance_[this->pio_ == pio0 ? 0 : 1] > 4) {
75
+ if (RP2040PIOLEDStripLightOutput::num_instance_[this->pio_ == pio0 ? 0 : 1] > 4) {
61
76
  ESP_LOGE(TAG, "Too many instances of PIO program");
62
77
  this->mark_failed();
63
78
  return;
64
79
  }
65
80
  // keep track of how many instances of the PIO program are running on each PIO
66
- num_instance_[this->pio_ == pio0 ? 0 : 1]++;
81
+ RP2040PIOLEDStripLightOutput::num_instance_[this->pio_ == pio0 ? 0 : 1]++;
67
82
 
68
83
  // if there are multiple strips of the same chipset, we can reuse the same PIO program and save space
69
84
  if (this->conf_count_[this->chipset_]) {
70
- offset = chipset_offsets_[this->chipset_];
85
+ offset = RP2040PIOLEDStripLightOutput::chipset_offsets_[this->chipset_];
71
86
  } else {
72
87
  // Load the assembled program into the PIO and get its location in the PIO's instruction memory and save it
73
88
  offset = pio_add_program(this->pio_, this->program_);
74
- chipset_offsets_[this->chipset_] = offset;
75
- conf_count_[this->chipset_] = true;
89
+ RP2040PIOLEDStripLightOutput::chipset_offsets_[this->chipset_] = offset;
90
+ RP2040PIOLEDStripLightOutput::conf_count_[this->chipset_] = true;
76
91
  }
77
92
 
78
93
  // Configure the state machine's PIO, and start it
@@ -93,6 +108,9 @@ void RP2040PIOLEDStripLightOutput::setup() {
93
108
  return;
94
109
  }
95
110
 
111
+ // Mark the DMA channel as active
112
+ RP2040PIOLEDStripLightOutput::dma_chan_active_[this->dma_chan_] = true;
113
+
96
114
  this->dma_config_ = dma_channel_get_default_config(this->dma_chan_);
97
115
  channel_config_set_transfer_data_size(
98
116
  &this->dma_config_,
@@ -109,6 +127,13 @@ void RP2040PIOLEDStripLightOutput::setup() {
109
127
  false // don't start yet
110
128
  );
111
129
 
130
+ // Initialize the semaphore for this DMA channel
131
+ sem_init(&RP2040PIOLEDStripLightOutput::dma_write_complete_sem_[this->dma_chan_], 1, 1);
132
+
133
+ irq_set_exclusive_handler(DMA_IRQ_0, dma_write_complete_handler_); // after DMA all data, raise an interrupt
134
+ dma_channel_set_irq0_enabled(this->dma_chan_, true); // map DMA channel to interrupt
135
+ irq_set_enabled(DMA_IRQ_0, true); // enable interrupt
136
+
112
137
  this->init_(this->pio_, this->sm_, offset, this->pin_, this->max_refresh_rate_);
113
138
  }
114
139
 
@@ -126,6 +151,7 @@ void RP2040PIOLEDStripLightOutput::write_state(light::LightState *state) {
126
151
  }
127
152
 
128
153
  // the bits are already in the correct order for the pio program so we can just copy the buffer using DMA
154
+ sem_acquire_blocking(&RP2040PIOLEDStripLightOutput::dma_write_complete_sem_[this->dma_chan_]);
129
155
  dma_channel_transfer_from_buffer_now(this->dma_chan_, this->buf_, this->get_buffer_size_());
130
156
  }
131
157
 
@@ -13,6 +13,7 @@
13
13
  #include <hardware/pio.h>
14
14
  #include <hardware/structs/pio.h>
15
15
  #include <pico/stdio.h>
16
+ #include <pico/sem.h>
16
17
  #include <map>
17
18
 
18
19
  namespace esphome {
@@ -95,6 +96,8 @@ class RP2040PIOLEDStripLightOutput : public light::AddressableLight {
95
96
 
96
97
  size_t get_buffer_size_() const { return this->num_leds_ * (3 + this->is_rgbw_); }
97
98
 
99
+ static void dma_write_complete_handler_();
100
+
98
101
  uint8_t *buf_{nullptr};
99
102
  uint8_t *effect_data_{nullptr};
100
103
 
@@ -120,6 +123,8 @@ class RP2040PIOLEDStripLightOutput : public light::AddressableLight {
120
123
  inline static int num_instance_[2];
121
124
  inline static std::map<Chipset, bool> conf_count_;
122
125
  inline static std::map<Chipset, int> chipset_offsets_;
126
+ inline static bool dma_chan_active_[12];
127
+ inline static struct semaphore dma_write_complete_sem_[12];
123
128
  };
124
129
 
125
130
  } // namespace rp2040_pio_led_strip
@@ -32,7 +32,7 @@ void Rtttl::play(std::string rtttl) {
32
32
  if (this->state_ != State::STATE_STOPPED && this->state_ != State::STATE_STOPPING) {
33
33
  int pos = this->rtttl_.find(':');
34
34
  auto name = this->rtttl_.substr(0, pos);
35
- ESP_LOGW(TAG, "RTTL Component is already playing: %s", name.c_str());
35
+ ESP_LOGW(TAG, "RTTTL Component is already playing: %s", name.c_str());
36
36
  return;
37
37
  }
38
38
 
@@ -122,6 +122,7 @@ void Rtttl::stop() {
122
122
  #ifdef USE_OUTPUT
123
123
  if (this->output_ != nullptr) {
124
124
  this->output_->set_level(0.0);
125
+ this->set_state_(STATE_STOPPED);
125
126
  }
126
127
  #endif
127
128
  #ifdef USE_SPEAKER
@@ -129,10 +130,10 @@ void Rtttl::stop() {
129
130
  if (this->speaker_->is_running()) {
130
131
  this->speaker_->stop();
131
132
  }
133
+ this->set_state_(STATE_STOPPING);
132
134
  }
133
135
  #endif
134
136
  this->note_duration_ = 0;
135
- this->set_state_(STATE_STOPPING);
136
137
  }
137
138
 
138
139
  void Rtttl::loop() {
@@ -342,6 +343,7 @@ void Rtttl::finish_() {
342
343
  #ifdef USE_OUTPUT
343
344
  if (this->output_ != nullptr) {
344
345
  this->output_->set_level(0.0);
346
+ this->set_state_(State::STATE_STOPPED);
345
347
  }
346
348
  #endif
347
349
  #ifdef USE_SPEAKER
@@ -354,9 +356,9 @@ void Rtttl::finish_() {
354
356
  this->speaker_->play((uint8_t *) (&sample), 8);
355
357
 
356
358
  this->speaker_->finish();
359
+ this->set_state_(State::STATE_STOPPING);
357
360
  }
358
361
  #endif
359
- this->set_state_(State::STATE_STOPPING);
360
362
  this->note_duration_ = 0;
361
363
  this->on_finished_playback_callback_.call();
362
364
  ESP_LOGD(TAG, "Playback finished");
@@ -480,7 +480,7 @@ void HOT WaveshareEPaperTypeA::display() {
480
480
  this->start_data_();
481
481
  switch (this->model_) {
482
482
  case TTGO_EPAPER_2_13_IN_B1: { // block needed because of variable initializations
483
- int16_t wb = ((this->get_width_internal()) >> 3);
483
+ int16_t wb = ((this->get_width_controller()) >> 3);
484
484
  for (int i = 0; i < this->get_height_internal(); i++) {
485
485
  for (int j = 0; j < wb; j++) {
486
486
  int idx = j + (this->get_height_internal() - 1 - i) * wb;
@@ -766,7 +766,7 @@ void WaveshareEPaper2P7InV2::initialize() {
766
766
  // XRAM_START_AND_END_POSITION
767
767
  this->command(0x44);
768
768
  this->data(0x00);
769
- this->data(((get_width_internal() - 1) >> 3) & 0xFF);
769
+ this->data(((this->get_width_controller() - 1) >> 3) & 0xFF);
770
770
  // YRAM_START_AND_END_POSITION
771
771
  this->command(0x45);
772
772
  this->data(0x00);
@@ -928,8 +928,8 @@ void HOT WaveshareEPaper2P7InB::display() {
928
928
 
929
929
  // TCON_RESOLUTION
930
930
  this->command(0x61);
931
- this->data(this->get_width_internal() >> 8);
932
- this->data(this->get_width_internal() & 0xff); // 176
931
+ this->data(this->get_width_controller() >> 8);
932
+ this->data(this->get_width_controller() & 0xff); // 176
933
933
  this->data(this->get_height_internal() >> 8);
934
934
  this->data(this->get_height_internal() & 0xff); // 264
935
935
 
@@ -994,7 +994,7 @@ void WaveshareEPaper2P7InBV2::initialize() {
994
994
  // self.SetWindows(0, 0, self.width-1, self.height-1)
995
995
  // SetWindows(self, Xstart, Ystart, Xend, Yend):
996
996
 
997
- uint32_t xend = this->get_width_internal() - 1;
997
+ uint32_t xend = this->get_width_controller() - 1;
998
998
  uint32_t yend = this->get_height_internal() - 1;
999
999
  this->command(0x44);
1000
1000
  this->data(0x00);
esphome/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants used by esphome."""
2
2
 
3
- __version__ = "2024.8.0b3"
3
+ __version__ = "2024.8.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.8.0b3
3
+ Version: 2024.8.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=GePHUM7xdXb_Pil59SHVsXg2F4VBPgkH-Fz2PDX8Z54,1873
5
5
  esphome/config.py,sha256=ArMupdqCpKqQm-vFWb85HueI88DAfYTjuhR6mA691DI,39614
6
6
  esphome/config_helpers.py,sha256=MKf_wzO35nn41FvigXE0iYKDslPgL2ruf8R-EPtTT2I,3256
7
7
  esphome/config_validation.py,sha256=Uck0GvA97sJ6sW25y0nqvOT2nsYIb6uZ_1sI-YBl4vc,65844
8
- esphome/const.py,sha256=gW_Ylnoo9hnOGQZRCz_BaYDmMBkA6n__s7u02jKqmE4,39410
8
+ esphome/const.py,sha256=_2ZuTcwBtxsMIuT9O7fzUEp3ptnaZLMvclhu9bCHoHw,39410
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
@@ -728,7 +728,7 @@ esphome/components/ens210/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
728
728
  esphome/components/ens210/ens210.cpp,sha256=ZFc51aAks8P3bCKi5EkkQaueYIf5C4i4YmDfCUJbzU0,8377
729
729
  esphome/components/ens210/ens210.h,sha256=yhCaQwB3GjeBYgOLXhuLCHELyjE3IrdL2e0Llfw9HU8,1545
730
730
  esphome/components/ens210/sensor.py,sha256=_ES1FNSEIwmZLNNzqUV_nGvjPx-i_j2pblAe6vg8f9M,1724
731
- esphome/components/esp32/__init__.py,sha256=Bz4ASUxPrD0ccNW3A8XJXo7FWCvO1JqcgdOdNWG4zWA,26180
731
+ esphome/components/esp32/__init__.py,sha256=B5Pvrw65UmbJFIV7sGjRoXROXM1Gb10UY1mluhWx6nc,26747
732
732
  esphome/components/esp32/boards.py,sha256=Fbn1QarvNqIbPV_yDTap128ZHszZiExIhK3wjQUS6w8,42736
733
733
  esphome/components/esp32/const.py,sha256=2yxLQg3p2-S3nRL6-zsF_dICrP_6waUfY5k8EFsoyVM,966
734
734
  esphome/components/esp32/core.cpp,sha256=GfidaExP8kU7ODM1S_VI9c3tQtmG2TaKwLJ-zzeSqd4,2413
@@ -2211,8 +2211,8 @@ esphome/components/rp2040/preferences.cpp,sha256=tSFwd7RWmbkJSfOUcq_y6rlNXpSxGlB
2211
2211
  esphome/components/rp2040/preferences.h,sha256=z7zFhLXLLmURu5RNaAlOpPIv2TnK8cvrGkGAyz0LvjM,216
2212
2212
  esphome/components/rp2040_pio/__init__.py,sha256=tKUlvHo2khh10A_LFOMuIc7MPswajSzz4FrVlYaGRw8,1244
2213
2213
  esphome/components/rp2040_pio_led_strip/__init__.py,sha256=QcyctD5MgxIKzfSZKAehNf2_W40eHvppWidpWMeDBHc,28
2214
- esphome/components/rp2040_pio_led_strip/led_strip.cpp,sha256=SWyDRMJL4UhlwWNhz8JHpAiAbCul4OVNhYcgoqoSDFg,6329
2215
- esphome/components/rp2040_pio_led_strip/led_strip.h,sha256=eha9Bf-dEkvFIjlErEvv8fR1f8QTGcjZbrSKBvDsxgA,3277
2214
+ esphome/components/rp2040_pio_led_strip/led_strip.cpp,sha256=ShiIeHQkA6ewjJL8QnKqKFq6w2N0ESxsA9xchK5bn_Y,7793
2215
+ esphome/components/rp2040_pio_led_strip/led_strip.h,sha256=G9aW-Wh9jbqXiXop2sW6BTrRfRzjgwLGmSzefdzv_-k,3450
2216
2216
  esphome/components/rp2040_pio_led_strip/light.py,sha256=7tF4FNmHwewBvPuGJMs2kFtITUeOIZ9Tfgt0UD4MAR4,7925
2217
2217
  esphome/components/rp2040_pwm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2218
2218
  esphome/components/rp2040_pwm/output.py,sha256=dU5-CZL5z_jvSf3cbJs4czckKvPmn1ifV5Th1zdqECk,1747
@@ -2225,7 +2225,7 @@ esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h,sha256=wQwb2lt50tVEkQ53Pj6Bm-KCGlc4
2225
2225
  esphome/components/rtl87xx/__init__.py,sha256=HIcczzFYGdNtOj635-gH0VVmBOZjmvcS4mxFWdlPtBo,1362
2226
2226
  esphome/components/rtl87xx/boards.py,sha256=JItSPj4n2UAvUXISoL2PTyTAqIi2Wp3sjGjs1fgS-3M,29269
2227
2227
  esphome/components/rtttl/__init__.py,sha256=m8vjSNfwcgbJm6NhDe_ErddMMwUpe2StubWcMY8sd28,4383
2228
- esphome/components/rtttl/rtttl.cpp,sha256=RbVz9upUhTCqoPMnQjLUDmDzuEBlA6yWKQ2Ml_aTxts,10779
2228
+ esphome/components/rtttl/rtttl.cpp,sha256=CxERszdc_mzMr-RPaI-vq0dQhmEoiMnV6cXiyCl1N_s,10865
2229
2229
  esphome/components/rtttl/rtttl.h,sha256=8xnisjG4Glm8JhCDB-RIyyS0yySGCLRsLnT24brQtYs,2946
2230
2230
  esphome/components/ruuvi_ble/__init__.py,sha256=9LmcfStqBeEzcuWdON_iGuI6Xh0BUssV1Aebv98Krks,619
2231
2231
  esphome/components/ruuvi_ble/ruuvi_ble.cpp,sha256=XXeYIgr1OB20MxtdcTDAWowFeK8qRQmQKTMeSEuhAec,5724
@@ -2970,7 +2970,7 @@ esphome/components/watchdog/watchdog.h,sha256=8Ro3Kgi9C1bYFBkNEeKc188EK63uI48Vuz
2970
2970
  esphome/components/waveshare_epaper/__init__.py,sha256=4Nn7UhpMJ9oSbuLdyVEW7G9PlIey2v33SWRNVizt9Oc,30
2971
2971
  esphome/components/waveshare_epaper/display.py,sha256=csFJ_y-O30w4_JJ75N-RP5VKTS8mMf45imk-yOW6_hg,8425
2972
2972
  esphome/components/waveshare_epaper/waveshare_213v3.cpp,sha256=DoXF6L9B2RodhIsCQ0myNycanrT50lx0JwxzW4Lluf4,7293
2973
- esphome/components/waveshare_epaper/waveshare_epaper.cpp,sha256=HAAr5VftK02f8L_UFnB5aR0DBXZ3We6E4rJf5gKJVbo,93318
2973
+ esphome/components/waveshare_epaper/waveshare_epaper.cpp,sha256=Ejvjvz-tKd9zF3MXjwCViEwXdqicxCPWn2zlSEPNues,93334
2974
2974
  esphome/components/waveshare_epaper/waveshare_epaper.h,sha256=DOI5LyxWob1x6Fqrwms0QvfsFVyRPzOF7gjv9f4nLK4,17990
2975
2975
  esphome/components/web_server/__init__.py,sha256=eAivKqka7nyjY-ZP9O2t6Tvm145fVJGh0Bgx9YkE3Sw,8627
2976
2976
  esphome/components/web_server/list_entities.cpp,sha256=PXfaW687audOXB2Gdx2Dtn2-J2XTbbQQgY_FivqE6DU,6214
@@ -3225,9 +3225,9 @@ esphome/dashboard/util/itertools.py,sha256=8eLrWEWmICLtXNxkKdYPQV0c_N4GEz8m9Npnb
3225
3225
  esphome/dashboard/util/password.py,sha256=cQz3b9B-ijTe7zS6BeCW0hc3pWv6JjC78jmnycYYAh8,321
3226
3226
  esphome/dashboard/util/subprocess.py,sha256=T8EW6dbU4LPd2DG1dRrdh8li71tt6J1isn411poMhkk,1022
3227
3227
  esphome/dashboard/util/text.py,sha256=ENDnfN4O0NdA3CKVJjQYabFbwbrsIhVKrAMQe53qYu4,534
3228
- esphome-2024.8.0b3.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3229
- esphome-2024.8.0b3.dist-info/METADATA,sha256=9BUeGDF4rU-BwxY-hpEJKgOrtSmV_N5jsGqTc8BsRdw,3265
3230
- esphome-2024.8.0b3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3231
- esphome-2024.8.0b3.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3232
- esphome-2024.8.0b3.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3233
- esphome-2024.8.0b3.dist-info/RECORD,,
3228
+ esphome-2024.8.0b4.dist-info/LICENSE,sha256=HzEjkBInJe44L4WvAOPfhPJJDNj6YbnqFyvGWRzArGM,36664
3229
+ esphome-2024.8.0b4.dist-info/METADATA,sha256=NkAgnS5odA3qDwNZMj2tm7mGD1mxKBimQ90uFphaItM,3265
3230
+ esphome-2024.8.0b4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3231
+ esphome-2024.8.0b4.dist-info/entry_points.txt,sha256=mIxVNuWtbYzeEcaWCl-AQ-97aBOWbnYBAK8nbF6P4M0,50
3232
+ esphome-2024.8.0b4.dist-info/top_level.txt,sha256=0GSXEW3cnITpgG3qnsSMz0qoqJHAFyfw7Y8MVtEf1Yk,8
3233
+ esphome-2024.8.0b4.dist-info/RECORD,,