diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 634c474571..96efee7020 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: # Run the formatter. - id: ruff-format - repo: https://github.com/PyCQA/flake8 - rev: 7.2.0 + rev: 7.3.0 hooks: - id: flake8 additional_dependencies: diff --git a/esphome/components/host/__init__.py b/esphome/components/host/__init__.py index e275adafa9..b59d8ebd03 100644 --- a/esphome/components/host/__init__.py +++ b/esphome/components/host/__init__.py @@ -41,6 +41,6 @@ CONFIG_SCHEMA = cv.All( async def to_code(config): cg.add_build_flag("-DUSE_HOST") cg.add_define("USE_ESPHOME_HOST_MAC_ADDRESS", config[CONF_MAC_ADDRESS].parts) - cg.add_build_flag("-std=c++17") + cg.add_build_flag("-std=gnu++17") cg.add_define("ESPHOME_BOARD", "host") cg.add_platformio_option("platform", "platformio/native") diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 43e7b79b8a..722c10f9e6 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -261,6 +261,17 @@ void Application::teardown_components(uint32_t timeout_ms) { } void Application::calculate_looping_components_() { + // Count total components that need looping + size_t total_looping = 0; + for (auto *obj : this->components_) { + if (obj->has_overridden_loop()) { + total_looping++; + } + } + + // Pre-reserve vector to avoid reallocations + this->looping_components_.reserve(total_looping); + // First add all active components for (auto *obj : this->components_) { if (obj->has_overridden_loop() && diff --git a/esphome/cpp_generator.py b/esphome/cpp_generator.py index 4641f69bdd..2a7b7fe057 100644 --- a/esphome/cpp_generator.py +++ b/esphome/cpp_generator.py @@ -616,6 +616,12 @@ def add_build_unflag(build_unflag: str) -> None: def set_cpp_standard(standard: str) -> None: """Set C++ standard with compiler flag `-std={standard}`.""" CORE.add_build_unflag("-std=gnu++11") + CORE.add_build_unflag("-std=gnu++14") + CORE.add_build_unflag("-std=gnu++20") + CORE.add_build_unflag("-std=gnu++23") + CORE.add_build_unflag("-std=gnu++2a") + CORE.add_build_unflag("-std=gnu++2b") + CORE.add_build_unflag("-std=gnu++2c") CORE.add_build_flag(f"-std={standard}") diff --git a/platformio.ini b/platformio.ini index f67226d657..6da9fc1338 100644 --- a/platformio.ini +++ b/platformio.ini @@ -50,6 +50,12 @@ build_flags = -std=gnu++17 build_unflags = -std=gnu++11 + -std=gnu++14 + -std=gnu++20 + -std=gnu++23 + -std=gnu++2a + -std=gnu++2b + -std=gnu++2c src_filter = +<./> +<../tests/dummy_main.cpp> diff --git a/requirements.txt b/requirements.txt index 76a58bf622..01bbfa91c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,10 +10,10 @@ tzlocal==5.3.1 # from time tzdata>=2021.1 # from time pyserial==3.5 platformio==6.1.18 # When updating platformio, also update /docker/Dockerfile -esptool==4.8.1 +esptool==4.9.0 click==8.1.7 esphome-dashboard==20250514.0 -aioesphomeapi==32.2.4 +aioesphomeapi==33.1.0 zeroconf==0.147.0 puremagic==1.29 ruamel.yaml==0.18.14 # dashboard_import diff --git a/requirements_test.txt b/requirements_test.txt index 9263d165ac..89aba702b9 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,5 +1,5 @@ pylint==3.3.7 -flake8==7.2.0 # also change in .pre-commit-config.yaml when updating +flake8==7.3.0 # also change in .pre-commit-config.yaml when updating ruff==0.12.0 # also change in .pre-commit-config.yaml when updating pyupgrade==3.20.0 # also change in .pre-commit-config.yaml when updating pre-commit