mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
Merge remote-tracking branch 'upstream/dev' into integration
This commit is contained in:
@@ -612,10 +612,12 @@ def _format_framework_espidf_version(
|
||||
ext = "tar.xz"
|
||||
else:
|
||||
ext = "zip"
|
||||
# Build version string with dot-separated extra (e.g., "5.5.3.1" not "5.5.3-1")
|
||||
# Build version string with extra separator based on type:
|
||||
# numeric extra uses dot (e.g., "5.5.3.1"), string extra uses dash (e.g., "6.0.0-rc1")
|
||||
ver_str = f"{ver.major}.{ver.minor}.{ver.patch}"
|
||||
if ver.extra:
|
||||
ver_str += f".{ver.extra}"
|
||||
sep = "." if str(ver.extra).isdigit() else "-"
|
||||
ver_str += f"{sep}{ver.extra}"
|
||||
if release:
|
||||
return f"pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v{ver_str}.{release}/esp-idf-v{ver_str}.{ext}"
|
||||
return f"pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v{ver_str}/esp-idf-v{ver_str}.{ext}"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#ifdef USE_ESP32
|
||||
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/ledc.h>
|
||||
#include <cinttypes>
|
||||
#include <esp_idf_version.h>
|
||||
@@ -189,7 +190,7 @@ void LEDCOutput::setup() {
|
||||
this->phase_angle_, hpoint);
|
||||
|
||||
ledc_channel_config_t chan_conf{};
|
||||
chan_conf.gpio_num = this->pin_->get_pin();
|
||||
chan_conf.gpio_num = static_cast<gpio_num_t>(this->pin_->get_pin());
|
||||
chan_conf.speed_mode = speed_mode;
|
||||
chan_conf.channel = chan_num;
|
||||
chan_conf.intr_type = LEDC_INTR_DISABLE;
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esp_lcd_panel_rgb.h"
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_lcd_panel_rgb.h>
|
||||
#include <span>
|
||||
|
||||
namespace esphome {
|
||||
@@ -153,18 +154,18 @@ void MipiRgb::common_setup_() {
|
||||
config.clk_src = LCD_CLK_SRC_PLL160M;
|
||||
size_t data_pin_count = sizeof(this->data_pins_) / sizeof(this->data_pins_[0]);
|
||||
for (size_t i = 0; i != data_pin_count; i++) {
|
||||
config.data_gpio_nums[i] = this->data_pins_[i]->get_pin();
|
||||
config.data_gpio_nums[i] = static_cast<gpio_num_t>(this->data_pins_[i]->get_pin());
|
||||
}
|
||||
config.data_width = data_pin_count;
|
||||
config.disp_gpio_num = -1;
|
||||
config.hsync_gpio_num = this->hsync_pin_->get_pin();
|
||||
config.vsync_gpio_num = this->vsync_pin_->get_pin();
|
||||
config.disp_gpio_num = GPIO_NUM_NC;
|
||||
config.hsync_gpio_num = static_cast<gpio_num_t>(this->hsync_pin_->get_pin());
|
||||
config.vsync_gpio_num = static_cast<gpio_num_t>(this->vsync_pin_->get_pin());
|
||||
if (this->de_pin_) {
|
||||
config.de_gpio_num = this->de_pin_->get_pin();
|
||||
config.de_gpio_num = static_cast<gpio_num_t>(this->de_pin_->get_pin());
|
||||
} else {
|
||||
config.de_gpio_num = -1;
|
||||
config.de_gpio_num = GPIO_NUM_NC;
|
||||
}
|
||||
config.pclk_gpio_num = this->pclk_pin_->get_pin();
|
||||
config.pclk_gpio_num = static_cast<gpio_num_t>(this->pclk_pin_->get_pin());
|
||||
esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
|
||||
if (err == ESP_OK)
|
||||
err = esp_lcd_panel_reset(this->handle_);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
#ifdef HAS_PCNT
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_private/esp_clk.h>
|
||||
#include <hal/pcnt_ll.h>
|
||||
#endif
|
||||
@@ -76,8 +77,8 @@ bool HwPulseCounterStorage::pulse_counter_setup(InternalGPIOPin *pin) {
|
||||
}
|
||||
|
||||
pcnt_chan_config_t chan_config = {
|
||||
.edge_gpio_num = this->pin->get_pin(),
|
||||
.level_gpio_num = -1,
|
||||
.edge_gpio_num = static_cast<gpio_num_t>(this->pin->get_pin()),
|
||||
.level_gpio_num = GPIO_NUM_NC,
|
||||
};
|
||||
error = pcnt_new_channel(this->pcnt_unit, &chan_config, &this->pcnt_channel);
|
||||
if (error != ESP_OK) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "rpi_dpi_rgb.h"
|
||||
#include "esphome/core/gpio.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include <driver/gpio.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace rpi_dpi_rgb {
|
||||
@@ -25,14 +26,14 @@ void RpiDpiRgb::setup() {
|
||||
config.clk_src = LCD_CLK_SRC_PLL160M;
|
||||
size_t data_pin_count = sizeof(this->data_pins_) / sizeof(this->data_pins_[0]);
|
||||
for (size_t i = 0; i != data_pin_count; i++) {
|
||||
config.data_gpio_nums[i] = this->data_pins_[i]->get_pin();
|
||||
config.data_gpio_nums[i] = static_cast<gpio_num_t>(this->data_pins_[i]->get_pin());
|
||||
}
|
||||
config.data_width = data_pin_count;
|
||||
config.disp_gpio_num = -1;
|
||||
config.hsync_gpio_num = this->hsync_pin_->get_pin();
|
||||
config.vsync_gpio_num = this->vsync_pin_->get_pin();
|
||||
config.de_gpio_num = this->de_pin_->get_pin();
|
||||
config.pclk_gpio_num = this->pclk_pin_->get_pin();
|
||||
config.disp_gpio_num = GPIO_NUM_NC;
|
||||
config.hsync_gpio_num = static_cast<gpio_num_t>(this->hsync_pin_->get_pin());
|
||||
config.vsync_gpio_num = static_cast<gpio_num_t>(this->vsync_pin_->get_pin());
|
||||
config.de_gpio_num = static_cast<gpio_num_t>(this->de_pin_->get_pin());
|
||||
config.pclk_gpio_num = static_cast<gpio_num_t>(this->pclk_pin_->get_pin());
|
||||
esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "lcd_new_rgb_panel failed: %s", esp_err_to_name(err));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "st7701s.h"
|
||||
#include "esphome/core/gpio.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include <driver/gpio.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace st7701s {
|
||||
@@ -27,14 +28,14 @@ void ST7701S::setup() {
|
||||
config.clk_src = LCD_CLK_SRC_PLL160M;
|
||||
size_t data_pin_count = sizeof(this->data_pins_) / sizeof(this->data_pins_[0]);
|
||||
for (size_t i = 0; i != data_pin_count; i++) {
|
||||
config.data_gpio_nums[i] = this->data_pins_[i]->get_pin();
|
||||
config.data_gpio_nums[i] = static_cast<gpio_num_t>(this->data_pins_[i]->get_pin());
|
||||
}
|
||||
config.data_width = data_pin_count;
|
||||
config.disp_gpio_num = -1;
|
||||
config.hsync_gpio_num = this->hsync_pin_->get_pin();
|
||||
config.vsync_gpio_num = this->vsync_pin_->get_pin();
|
||||
config.de_gpio_num = this->de_pin_->get_pin();
|
||||
config.pclk_gpio_num = this->pclk_pin_->get_pin();
|
||||
config.disp_gpio_num = GPIO_NUM_NC;
|
||||
config.hsync_gpio_num = static_cast<gpio_num_t>(this->hsync_pin_->get_pin());
|
||||
config.vsync_gpio_num = static_cast<gpio_num_t>(this->vsync_pin_->get_pin());
|
||||
config.de_gpio_num = static_cast<gpio_num_t>(this->de_pin_->get_pin());
|
||||
config.pclk_gpio_num = static_cast<gpio_num_t>(this->pclk_pin_->get_pin());
|
||||
esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
|
||||
if (err != ESP_OK) {
|
||||
esph_log_e(TAG, "lcd_new_rgb_panel failed: %s", esp_err_to_name(err));
|
||||
|
||||
@@ -7,17 +7,26 @@ import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from esphome import config_validation as cv
|
||||
from esphome.components.esp32 import PLATFORM_VERSION_LOOKUP
|
||||
from esphome.helpers import write_file_if_changed
|
||||
|
||||
ver = PLATFORM_VERSION_LOOKUP["recommended"]
|
||||
version_str = f"{ver.major}.{ver.minor:02d}.{ver.patch:02d}"
|
||||
root = Path(__file__).parent.parent
|
||||
boards_file_path = root / "esphome" / "components" / "esp32" / "boards.py"
|
||||
|
||||
|
||||
def get_boards():
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
if isinstance(ver, cv.Version):
|
||||
branch = f"{ver.major}.{ver.minor:02d}.{ver.patch:02d}"
|
||||
if ver.extra:
|
||||
branch += f"-{ver.extra}"
|
||||
repo = "https://github.com/pioarduino/platform-espressif32"
|
||||
else:
|
||||
# URL format: "https://github.com/user/repo.git#branch"
|
||||
url = str(ver)
|
||||
repo, branch = url.rsplit("#", 1) if "#" in url else (url, "main")
|
||||
subprocess.run(
|
||||
[
|
||||
"git",
|
||||
@@ -28,8 +37,8 @@ def get_boards():
|
||||
"--depth",
|
||||
"1",
|
||||
"--branch",
|
||||
f"{ver.major}.{ver.minor:02d}.{ver.patch:02d}",
|
||||
"https://github.com/pioarduino/platform-espressif32",
|
||||
branch,
|
||||
repo,
|
||||
tempdir,
|
||||
],
|
||||
check=True,
|
||||
|
||||
@@ -3,7 +3,7 @@ esphome:
|
||||
|
||||
host:
|
||||
api:
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
@@ -15,8 +15,8 @@ sensor:
|
||||
|
||||
- platform: copy
|
||||
source_id: source_nan_sensor
|
||||
name: "Min NaN Sensor"
|
||||
id: min_nan_sensor
|
||||
name: "Min NaN"
|
||||
id: min_nan
|
||||
filters:
|
||||
- min:
|
||||
window_size: 5
|
||||
@@ -25,8 +25,8 @@ sensor:
|
||||
|
||||
- platform: copy
|
||||
source_id: source_nan_sensor
|
||||
name: "Max NaN Sensor"
|
||||
id: max_nan_sensor
|
||||
name: "Max NaN"
|
||||
id: max_nan
|
||||
filters:
|
||||
- max:
|
||||
window_size: 5
|
||||
@@ -42,7 +42,7 @@ script:
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
state: !lambda 'return NAN;'
|
||||
state: !lambda "return NAN;"
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
@@ -50,7 +50,7 @@ script:
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
state: !lambda 'return NAN;'
|
||||
state: !lambda "return NAN;"
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
@@ -62,7 +62,7 @@ script:
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
state: !lambda 'return NAN;'
|
||||
state: !lambda "return NAN;"
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
@@ -74,7 +74,7 @@ script:
|
||||
- delay: 20ms
|
||||
- sensor.template.publish:
|
||||
id: source_nan_sensor
|
||||
state: !lambda 'return NAN;'
|
||||
state: !lambda "return NAN;"
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
|
||||
@@ -3,7 +3,7 @@ esphome:
|
||||
|
||||
host:
|
||||
api:
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
@@ -18,8 +18,8 @@ sensor:
|
||||
# Window of 5, send every 2 values
|
||||
- platform: copy
|
||||
source_id: source_sensor
|
||||
name: "Sliding Min Sensor"
|
||||
id: sliding_min_sensor
|
||||
name: "Sliding Min"
|
||||
id: sliding_min
|
||||
filters:
|
||||
- min:
|
||||
window_size: 5
|
||||
@@ -28,8 +28,8 @@ sensor:
|
||||
|
||||
- platform: copy
|
||||
source_id: source_sensor
|
||||
name: "Sliding Max Sensor"
|
||||
id: sliding_max_sensor
|
||||
name: "Sliding Max"
|
||||
id: sliding_max
|
||||
filters:
|
||||
- max:
|
||||
window_size: 5
|
||||
@@ -38,8 +38,8 @@ sensor:
|
||||
|
||||
- platform: copy
|
||||
source_id: source_sensor
|
||||
name: "Sliding Median Sensor"
|
||||
id: sliding_median_sensor
|
||||
name: "Sliding Median"
|
||||
id: sliding_median
|
||||
filters:
|
||||
- median:
|
||||
window_size: 5
|
||||
@@ -48,8 +48,8 @@ sensor:
|
||||
|
||||
- platform: copy
|
||||
source_id: source_sensor
|
||||
name: "Sliding Moving Avg Sensor"
|
||||
id: sliding_moving_avg_sensor
|
||||
name: "Sliding Moving Avg"
|
||||
id: sliding_moving_avg
|
||||
filters:
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
|
||||
@@ -3,20 +3,20 @@ esphome:
|
||||
|
||||
host:
|
||||
api:
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
name: "Source Wraparound Sensor"
|
||||
name: "Source Wraparound"
|
||||
id: source_wraparound
|
||||
accuracy_decimals: 2
|
||||
|
||||
- platform: copy
|
||||
source_id: source_wraparound
|
||||
name: "Wraparound Min Sensor"
|
||||
id: wraparound_min_sensor
|
||||
name: "Wraparound Min"
|
||||
id: wraparound_min
|
||||
filters:
|
||||
- min:
|
||||
window_size: 3
|
||||
|
||||
@@ -88,7 +88,7 @@ def build_key_to_entity_mapping(
|
||||
|
||||
Args:
|
||||
entities: List of entity info objects from the API
|
||||
entity_names: List of entity names to search for in object_ids
|
||||
entity_names: List of entity names to match exactly against object_ids
|
||||
|
||||
Returns:
|
||||
Dictionary mapping entity keys to entity names
|
||||
@@ -97,7 +97,7 @@ def build_key_to_entity_mapping(
|
||||
for entity in entities:
|
||||
obj_id = entity.object_id.lower()
|
||||
for entity_name in entity_names:
|
||||
if entity_name in obj_id:
|
||||
if entity_name == obj_id:
|
||||
key_to_entity[entity.key] = entity_name
|
||||
break
|
||||
return key_to_entity
|
||||
|
||||
Reference in New Issue
Block a user