Merge remote-tracking branch 'upstream/dev' into integration

This commit is contained in:
J. Nick Koston
2026-03-20 15:14:58 -10:00
13 changed files with 107 additions and 5 deletions
+5 -2
View File
@@ -1943,8 +1943,11 @@ async def to_code(config):
# IDF 6.0 switched from Newlib to PicolibC. The shim provides thread-local
# stdin/stdout/stderr and getreent() for code compiled against Newlib.
# ESPHome doesn't link against Newlib-built libraries that use stdio.
# If a component needs it (e.g. precompiled Newlib binaries), re-enable via
# sdkconfig_options: CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY: "y"
# If a component needs it (e.g. precompiled Newlib binaries), re-enable via:
# esp32:
# framework:
# sdkconfig_options:
# CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY: "y"
if idf_version() >= cv.Version(6, 0, 0):
add_idf_sdkconfig_option("CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY", False)
@@ -360,11 +360,16 @@ void ESP32TouchComponent::loop() {
}
// Publish initial OFF state for sensors that haven't received events yet
bool all_initial_published = true;
for (auto *child : this->children_) {
this->publish_initial_state_if_needed_(child, now);
if (!child->initial_state_published_) {
all_initial_published = false;
}
}
if (!this->setup_mode_) {
// Only disable loop once all initial states are published
if (!this->setup_mode_ && all_initial_published) {
this->disable_loop();
}
}
+2 -2
View File
@@ -415,10 +415,10 @@ void Modbus::clear_rx_buffer_(const LogString *reason, bool warn) {
size_t at = this->rx_buffer_.size();
if (at > 0) {
if (warn) {
ESP_LOGW(TAG, "Clearing buffer of %" PRIu32 " bytes - %s %" PRIu32 "ms after last send", at, LOG_STR_ARG(reason),
ESP_LOGW(TAG, "Clearing buffer of %zu bytes - %s %" PRIu32 "ms after last send", at, LOG_STR_ARG(reason),
millis() - this->last_send_);
} else {
ESP_LOGV(TAG, "Clearing buffer of %" PRIu32 " bytes - %s %" PRIu32 "ms after last send", at, LOG_STR_ARG(reason),
ESP_LOGV(TAG, "Clearing buffer of %zu bytes - %s %" PRIu32 "ms after last send", at, LOG_STR_ARG(reason),
millis() - this->last_send_);
}
this->rx_buffer_.clear();
+23
View File
@@ -0,0 +1,23 @@
import esphome.codegen as cg
from esphome.components import i2c
import esphome.config_validation as cv
from ..spa06_base import CONFIG_SCHEMA_BASE, to_code_base
AUTO_LOAD = ["spa06_base"]
CODEOWNERS = ["@danielkent-net"]
DEPENDENCIES = ["i2c"]
spa06_ns = cg.esphome_ns.namespace("spa06_i2c")
SPA06I2CComponent = spa06_ns.class_(
"SPA06I2CComponent", cg.PollingComponent, i2c.I2CDevice
)
CONFIG_SCHEMA = CONFIG_SCHEMA_BASE.extend(
i2c.i2c_device_schema(default_address=0x77)
).extend({cv.GenerateID(): cv.declare_id(SPA06I2CComponent)})
async def to_code(config):
var = await to_code_base(config)
await i2c.register_i2c_device(var, config)
@@ -0,0 +1,14 @@
#include "spa06_i2c.h"
#include "esphome/core/hal.h"
#include "esphome/core/log.h"
namespace esphome::spa06_i2c {
static const char *const TAG = "spa06_i2c";
void SPA06I2CComponent::dump_config() {
LOG_I2C_DEVICE(this);
SPA06Component::dump_config();
}
} // namespace esphome::spa06_i2c
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include "esphome/components/spa06_base/spa06_base.h"
#include "esphome/components/i2c/i2c.h"
namespace esphome::spa06_i2c {
class SPA06I2CComponent : public spa06_base::SPA06Component, public i2c::I2CDevice {
public:
bool spa_read_byte(uint8_t a_register, uint8_t *data) override { return read_byte(a_register, data); }
bool spa_write_byte(uint8_t a_register, uint8_t data) override { return write_byte(a_register, data); }
bool spa_read_bytes(uint8_t a_register, uint8_t *data, size_t len) override {
return read_bytes(a_register, data, len);
}
bool spa_write_bytes(uint8_t a_register, uint8_t *data, size_t len) override {
return write_bytes(a_register, data, len);
}
void dump_config() override;
};
} // namespace esphome::spa06_i2c