Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kbx81 authored Dec 2, 2024
2 parents 29a9f0c + 9c8976b commit 900b3dc
Show file tree
Hide file tree
Showing 189 changed files with 2,512 additions and 792 deletions.
35 changes: 31 additions & 4 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,38 @@ Checks: >-
-boost-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-switch-missing-default-case,
-cert-dcl50-cpp,
-cert-err33-c,
-cert-err58-cpp,
-cert-oop57-cpp,
-cert-str34-c,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-osx.*,
-clang-diagnostic-delete-abstract-non-virtual-dtor,
-clang-diagnostic-delete-non-abstract-non-virtual-dtor,
-clang-diagnostic-ignored-optimization-argument,
-clang-diagnostic-missing-field-initializers,
-clang-diagnostic-shadow-field,
-clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-parameter,
-clang-diagnostic-vla-cxx-extension,
-concurrency-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-missing-std-forward,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
Expand All @@ -40,7 +50,9 @@ Checks: >-
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-rvalue-reference-param-not-moved,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-use-default-member-init,
-cppcoreguidelines-virtual-class-destructor,
-fuchsia-multiple-inheritance,
-fuchsia-overloaded-operator,
Expand All @@ -60,20 +72,32 @@ Checks: >-
-llvm-include-order,
-llvm-qualified-auto,
-llvmlibc-*,
-misc-non-private-member-variables-in-classes,
-misc-const-correctness,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-modernize-avoid-c-arrays,
-misc-use-anonymous-namespace,
-modernize-avoid-bind,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-macro-to-enum,
-modernize-return-braced-init-list,
-modernize-type-traits,
-modernize-use-auto,
-modernize-use-constraints,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-modernize-use-nullptr,
-modernize-use-nodiscard,
-modernize-use-nullptr,
-modernize-use-trailing-return-type,
-mpi-*,
-objc-*,
-performance-enum-size,
-readability-avoid-nested-conditional-operator,
-readability-container-contains,
-readability-container-data-pointer,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
Expand All @@ -82,11 +106,14 @@ Checks: >-
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-casting,
-readability-redundant-inline-specifier,
-readability-redundant-member-init,
-readability-redundant-string-init,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof,
WarningsAsErrors: '*'
AnalyzeTemporaryDtors: false
FormatStyle: google
CheckOptions:
- key: google-readability-function-size.StatementThreshold
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
- name: Build and push to ghcr by digest
id: build-ghcr
uses: docker/build-push-action@v6.9.0
uses: docker/build-push-action@v6.10.0
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
Expand All @@ -72,7 +72,7 @@ runs:
- name: Build and push to dockerhub by digest
id: build-dockerhub
uses: docker/build-push-action@v6.9.0
uses: docker/build-push-action@v6.10.0
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
Expand Down
31 changes: 13 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ concurrency:
jobs:
common:
name: Create common environment
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
steps:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
black:
name: Check black
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
Expand All @@ -83,7 +83,7 @@ jobs:

flake8:
name: Check flake8
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
Expand All @@ -104,7 +104,7 @@ jobs:

pylint:
name: Check pylint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
Expand All @@ -125,7 +125,7 @@ jobs:

pyupgrade:
name: Check pyupgrade
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
Expand All @@ -146,7 +146,7 @@ jobs:

ci-custom:
name: Run script/ci-custom
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:

clang-format:
name: Check clang-format
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
Expand All @@ -251,7 +251,7 @@ jobs:

clang-tidy:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- black
Expand Down Expand Up @@ -314,11 +314,6 @@ jobs:
path: ~/.platformio
key: platformio-${{ matrix.pio_cache_key }}

- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install clang-tidy-14
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/gcc.json"
Expand All @@ -345,7 +340,7 @@ jobs:
if: always()

list-components:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -387,7 +382,7 @@ jobs:
test-build-components:
name: Component test ${{ matrix.file }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- list-components
Expand Down Expand Up @@ -421,7 +416,7 @@ jobs:
test-build-components-splitter:
name: Split components for testing into 20 groups maximum
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- list-components
Expand All @@ -439,7 +434,7 @@ jobs:
test-build-components-split:
name: Test split components
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- list-components
Expand Down Expand Up @@ -483,7 +478,7 @@ jobs:
ci-status:
name: CI Status
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- black
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ esphome/components/haier/text_sensor/* @paveldn
esphome/components/havells_solar/* @sourabhjaiswal
esphome/components/hbridge/fan/* @WeekendWarrior
esphome/components/hbridge/light/* @DotNetDann
esphome/components/hbridge/switch/* @dwmw2
esphome/components/he60r/* @clydebarrow
esphome/components/heatpumpir/* @rob-deutsch
esphome/components/hitachi_ac424/* @sourabhjaiswal
Expand Down Expand Up @@ -354,6 +355,7 @@ esphome/components/sdl/* @clydebarrow
esphome/components/sdm_meter/* @jesserockz @polyfaces
esphome/components/sdp3x/* @Azimath
esphome/components/seeed_mr24hpc1/* @limengdu
esphome/components/seeed_mr60fda2/* @limengdu
esphome/components/selec_meter/* @sourabhjaiswal
esphome/components/select/* @esphome/core
esphome/components/sen0321/* @notjj
Expand Down Expand Up @@ -408,6 +410,7 @@ esphome/components/substitutions/* @esphome/core
esphome/components/sun/* @OttoWinter
esphome/components/sun_gtil2/* @Mat931
esphome/components/switch/* @esphome/core
esphome/components/switch/binary_sensor/* @ssieb
esphome/components/t6615/* @tylermenezes
esphome/components/tc74/* @sethgirvan
esphome/components/tca9548a/* @andreashergert1984
Expand Down
16 changes: 11 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,17 @@ BUILD_DEPS="
libfreetype-dev=2.12.1+dfsg-5+deb12u3
libssl-dev=3.0.15-1~deb12u1
libffi-dev=3.4.4-1
libopenjp2-7=2.5.0-2
libtiff6=4.5.0-6+deb12u1
cargo=0.66.0+ds1-1
pkg-config=1.8.1-1
"
LIB_DEPS="
libtiff6=4.5.0-6+deb12u1
libopenjp2-7=2.5.0-2
"
if [ "$TARGETARCH$TARGETVARIANT" = "arm64" ] || [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]
then
apt-get update
apt-get install -y --no-install-recommends $BUILD_DEPS
apt-get install -y --no-install-recommends $BUILD_DEPS $LIB_DEPS
fi

CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse CARGO_HOME=/root/.cargo
Expand Down Expand Up @@ -207,11 +209,12 @@ ENV \
PLATFORMIO_CORE_DIR=/esphome/.temp/platformio

RUN \
apt-get update \
curl -L https://apt.llvm.org/llvm-snapshot.gpg.key -o /etc/apt/trusted.gpg.d/apt.llvm.org.asc \
&& echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main" > /etc/apt/sources.list.d/llvm.sources.list \
&& apt-get update \
# Use pinned versions so that we get updates with build caching
&& apt-get install -y --no-install-recommends \
clang-format-13=1:13.0.1-11+b2 \
clang-tidy-14=1:14.0.6-12 \
patch=2.7.6-7 \
software-properties-common=0.99.30-4.1~deb12u1 \
nano=7.2-1+deb12u1 \
Expand All @@ -225,6 +228,9 @@ RUN \
COPY requirements_test.txt /
RUN if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
else \
# move this up into RUN above after armv7 is retired
apt-get install -y --no-install-recommends clang-tidy-18=1:18.1.8~++20240731024826+3b5b5c1ec4a3-1~exp1~20240731144843.145 ; \
fi; \
pip3 install \
--break-system-packages --no-cache-dir -r /requirements_test.txt
Expand Down
2 changes: 1 addition & 1 deletion esphome/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def upload_program(config, args, host):

from esphome import espota2

remote_port = ota_conf[CONF_PORT]
remote_port = int(ota_conf[CONF_PORT])
password = ota_conf.get(CONF_PASSWORD, "")

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ void AlarmControlPanelCall::validate_() {
this->state_.reset();
return;
}
if (state == ACP_STATE_DISARMED &&
!(this->parent_->is_state_armed(this->parent_->get_state()) ||
this->parent_->get_state() == ACP_STATE_PENDING || this->parent_->get_state() == ACP_STATE_ARMING ||
this->parent_->get_state() == ACP_STATE_TRIGGERED)) {
if (state == ACP_STATE_DISARMED && !this->parent_->is_state_armed(this->parent_->get_state()) &&
this->parent_->get_state() != ACP_STATE_PENDING && this->parent_->get_state() != ACP_STATE_ARMING &&
this->parent_->get_state() != ACP_STATE_TRIGGERED) {
ESP_LOGW(TAG, "Cannot disarm when not armed");
this->state_.reset();
return;
Expand Down
3 changes: 1 addition & 2 deletions esphome/components/animation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from esphome import automation, core
import esphome.codegen as cg
from esphome.components import font
import esphome.components.image as espImage
from esphome.components.image import (
CONF_USE_TRANSPARENCY,
Expand Down Expand Up @@ -131,7 +130,7 @@ def validate_cross_dependencies(config):
)
)

CONFIG_SCHEMA = cv.All(font.validate_pillow_installed, ANIMATION_SCHEMA)
CONFIG_SCHEMA = ANIMATION_SCHEMA

NEXT_FRAME_SCHEMA = automation.maybe_simple_id(
{
Expand Down
3 changes: 2 additions & 1 deletion esphome/components/apds9306/apds9306.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ void APDS9306::update() {

this->status_clear_warning();

if (!(status &= 0b00001000)) { // No new data
status &= 0b00001000;
if (!status) { // No new data
return;
}

Expand Down
2 changes: 1 addition & 1 deletion esphome/components/audio/audio.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <cstddef>
#include <cstdint>
#include <stddef.h>

namespace esphome {
namespace audio {
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/binary_sensor/binary_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class BinarySensor : public EntityBase, public EntityBase_DeviceClass {
void publish_initial_state(bool state);

/// The current reported state of the binary sensor.
bool state;
bool state{false};

void add_filter(Filter *filter);
void add_filters(const std::vector<Filter *> &filters);
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/bk72xx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from esphome.core import CORE

from .boards import BK72XX_BOARDS, BK72XX_BOARD_PINS
from .boards import BK72XX_BOARD_PINS, BK72XX_BOARDS

CODEOWNERS = ["@kuba2k2"]
AUTO_LOAD = ["libretiny"]
Expand Down
Loading

0 comments on commit 900b3dc

Please sign in to comment.