1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-01 09:32:21 +01:00

Merge branch 'scheduler_pool_v2' into integration

This commit is contained in:
J. Nick Koston
2025-09-03 16:21:50 -05:00
7 changed files with 24 additions and 10 deletions

View File

@@ -80,7 +80,7 @@ CONFIG_SCHEMA = cv.All(
cv.Schema( cv.Schema(
{ {
cv.GenerateID(): cv.declare_id(BluetoothProxy), cv.GenerateID(): cv.declare_id(BluetoothProxy),
cv.Optional(CONF_ACTIVE, default=False): cv.boolean, cv.Optional(CONF_ACTIVE, default=True): cv.boolean,
cv.SplitDefault(CONF_CACHE_SERVICES, esp32_idf=True): cv.All( cv.SplitDefault(CONF_CACHE_SERVICES, esp32_idf=True): cv.All(
cv.only_with_esp_idf, cv.boolean cv.only_with_esp_idf, cv.boolean
), ),

View File

@@ -40,6 +40,7 @@ from esphome.cpp_generator import RawExpression
import esphome.final_validate as fv import esphome.final_validate as fv
from esphome.helpers import copy_file_if_changed, mkdir_p, write_file_if_changed from esphome.helpers import copy_file_if_changed, mkdir_p, write_file_if_changed
from esphome.types import ConfigType from esphome.types import ConfigType
from esphome.writer import clean_cmake_cache
from .boards import BOARDS, STANDARD_BOARDS from .boards import BOARDS, STANDARD_BOARDS
from .const import ( # noqa from .const import ( # noqa
@@ -840,6 +841,9 @@ async def to_code(config):
if conf[CONF_ADVANCED][CONF_IGNORE_EFUSE_CUSTOM_MAC]: if conf[CONF_ADVANCED][CONF_IGNORE_EFUSE_CUSTOM_MAC]:
cg.add_define("USE_ESP32_IGNORE_EFUSE_CUSTOM_MAC") cg.add_define("USE_ESP32_IGNORE_EFUSE_CUSTOM_MAC")
for clean_var in ("IDF_PATH", "IDF_TOOLS_PATH"):
os.environ.pop(clean_var, None)
add_extra_script( add_extra_script(
"post", "post",
"post_build.py", "post_build.py",
@@ -1074,7 +1078,11 @@ def _write_idf_component_yml():
contents = yaml_util.dump({"dependencies": dependencies}) contents = yaml_util.dump({"dependencies": dependencies})
else: else:
contents = "" contents = ""
write_file_if_changed(yml_path, contents) if write_file_if_changed(yml_path, contents):
dependencies_lock = CORE.relative_build_path("dependencies.lock")
if os.path.isfile(dependencies_lock):
os.remove(dependencies_lock)
clean_cmake_cache()
# Called by writer.py # Called by writer.py

View File

@@ -47,9 +47,9 @@ ErrorCode I2CDevice::write_register(uint8_t a_register, const uint8_t *data, siz
ErrorCode I2CDevice::write_register16(uint16_t a_register, const uint8_t *data, size_t len) const { ErrorCode I2CDevice::write_register16(uint16_t a_register, const uint8_t *data, size_t len) const {
std::vector<uint8_t> v(len + 2); std::vector<uint8_t> v(len + 2);
v.push_back(a_register >> 8); v[0] = a_register >> 8;
v.push_back(a_register); v[1] = a_register;
v.insert(v.end(), data, data + len); std::copy(data, data + len, v.begin() + 2);
return bus_->write_readv(this->address_, v.data(), v.size(), nullptr, 0); return bus_->write_readv(this->address_, v.data(), v.size(), nullptr, 0);
} }

View File

@@ -51,7 +51,7 @@ from . import wpa2_eap
AUTO_LOAD = ["network"] AUTO_LOAD = ["network"]
NO_WIFI_VARIANTS = [const.VARIANT_ESP32H2] NO_WIFI_VARIANTS = [const.VARIANT_ESP32H2, const.VARIANT_ESP32P4]
CONF_SAVE = "save" CONF_SAVE = "save"
wifi_ns = cg.esphome_ns.namespace("wifi") wifi_ns = cg.esphome_ns.namespace("wifi")
@@ -179,8 +179,8 @@ WIFI_NETWORK_STA = WIFI_NETWORK_BASE.extend(
def validate_variant(_): def validate_variant(_):
if CORE.is_esp32: if CORE.is_esp32:
variant = get_esp32_variant() variant = get_esp32_variant()
if variant in NO_WIFI_VARIANTS: if variant in NO_WIFI_VARIANTS and "esp32_hosted" not in fv.full_config.get():
raise cv.Invalid(f"{variant} does not support WiFi") raise cv.Invalid(f"WiFi requires component esp32_hosted on {variant}")
def final_validate(config): def final_validate(config):

View File

@@ -310,6 +310,10 @@ def clean_build():
if os.path.isdir(piolibdeps): if os.path.isdir(piolibdeps):
_LOGGER.info("Deleting %s", piolibdeps) _LOGGER.info("Deleting %s", piolibdeps)
shutil.rmtree(piolibdeps) shutil.rmtree(piolibdeps)
dependencies_lock = CORE.relative_build_path("dependencies.lock")
if os.path.isfile(dependencies_lock):
_LOGGER.info("Deleting %s", dependencies_lock)
os.remove(dependencies_lock)
GITIGNORE_CONTENT = """# Gitignore settings for ESPHome GITIGNORE_CONTENT = """# Gitignore settings for ESPHome

View File

@@ -1059,7 +1059,9 @@ def _generate_array_dump_content(
# Check if underlying type can use dump_field # Check if underlying type can use dump_field
if ti.can_use_dump_field(): if ti.can_use_dump_field():
# For types that have dump_field overloads, use them with extra indent # For types that have dump_field overloads, use them with extra indent
o += f' dump_field(out, "{name}", {ti.dump_field_value("it")}, 4);\n' # std::vector<bool> iterators return proxy objects, need explicit cast
value_expr = "static_cast<bool>(it)" if is_bool else ti.dump_field_value("it")
o += f' dump_field(out, "{name}", {value_expr}, 4);\n'
else: else:
# For complex types (messages, bytes), use the old pattern # For complex types (messages, bytes), use the old pattern
o += f' out.append(" {name}: ");\n' o += f' out.append(" {name}: ");\n'

View File

@@ -4,7 +4,7 @@ esphome:
host: host:
logger: logger:
level: DEBUG level: VERY_VERBOSE
api: api:
actions: actions: