From 89fd3672970ecbcaf2bcc63c5bd43936f749ed18 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 6 Sep 2022 15:48:01 +1200 Subject: [PATCH] YAML linting (#3779) --- .editorconfig | 3 +- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/config.yml | 8 +- .github/dependabot.yml | 7 +- .github/workflows/ci-docker.yml | 56 +- .github/workflows/ci.yml | 21 +- .github/workflows/lock.yml | 4 +- .github/workflows/release.yml | 104 +-- .github/workflows/stale.yml | 7 +- .gitpod.yml | 10 +- .pre-commit-config.yaml | 11 +- .yamllint | 3 + .../binary_sensor/test_binary_sensor.yaml | 5 +- tests/component_tests/button/test_button.yaml | 1 + .../deep_sleep/test_deep_sleep1.yaml | 1 + .../deep_sleep/test_deep_sleep2.yaml | 1 + tests/component_tests/sensor/test_sensor.yaml | 5 +- tests/test1.yaml | 775 +++++++++--------- tests/test2.yaml | 321 ++++---- tests/test3.yaml | 427 +++++----- tests/test4.yaml | 95 +-- tests/test5.yaml | 91 +- .../test_packages/test_packages_package1.yaml | 1 + .../test_packages_package_wifi.yaml | 5 +- tests/test_packages/test_uptime_sensor.yaml | 1 + .../fixtures/yaml_util/includes/scalar.yaml | 1 + .../fixtures/yaml_util/includetest.yaml | 7 +- 27 files changed, 1039 insertions(+), 933 deletions(-) create mode 100644 .yamllint diff --git a/.editorconfig b/.editorconfig index 8ccf1eeebc..9e203f60e4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -25,10 +25,9 @@ indent_size = 2 [*.{yaml,yml}] indent_style = space indent_size = 2 -quote_type = single +quote_type = double # JSON [*.json] indent_style = space indent_size = 2 - diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 864586fe6b..a8ca63d158 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,4 @@ +--- # These are supported funding model platforms custom: https://www.nabucasa.com diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7f99701e39..804dad47c7 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,4 @@ +--- blank_issues_enabled: false contact_links: - name: Issue Tracker @@ -5,7 +6,10 @@ contact_links: about: Please create bug reports in the dedicated issue tracker. - name: Feature Request Tracker url: https://github.com/esphome/feature-requests - about: Please create feature requests in the dedicated feature request tracker. + about: | + Please create feature requests in the dedicated feature request tracker. - name: Frequently Asked Question url: https://esphome.io/guides/faq.html - about: Please view the FAQ for common questions and what to include in a bug report. + about: | + Please view the FAQ for common questions and what + to include in a bug report. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c67378093e..666532f360 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,14 @@ +--- version: 2 updates: - - package-ecosystem: "pip" + - package-ecosystem: pip directory: "/" schedule: - interval: "daily" + interval: daily ignore: # Hypotehsis is only used for testing and is updated quite often - dependency-name: hypothesis - - package-ecosystem: "github-actions" + - package-ecosystem: github-actions directory: "/" schedule: interval: daily diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index d424bd3b60..7eb4cd1f66 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -1,21 +1,23 @@ +--- name: CI for docker images # Only run when docker paths change +# yamllint disable-line rule:truthy on: push: branches: [dev, beta, release] paths: - - 'docker/**' - - '.github/workflows/**' - - 'requirements*.txt' - - 'platformio.ini' + - "docker/**" + - ".github/workflows/**" + - "requirements*.txt" + - "platformio.ini" pull_request: paths: - - 'docker/**' - - '.github/workflows/**' - - 'requirements*.txt' - - 'platformio.ini' + - "docker/**" + - ".github/workflows/**" + - "requirements*.txt" + - "platformio.ini" permissions: contents: read @@ -30,24 +32,24 @@ jobs: arch: [amd64, armv7, aarch64] build_type: ["ha-addon", "docker", "lint"] steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 - - name: Set TAG - run: | - echo "TAG=check" >> $GITHUB_ENV + - name: Set TAG + run: | + echo "TAG=check" >> $GITHUB_ENV - - name: Run build - run: | - docker/build.py \ - --tag "${TAG}" \ - --arch "${{ matrix.arch }}" \ - --build-type "${{ matrix.build_type }}" \ - build + - name: Run build + run: | + docker/build.py \ + --tag "${TAG}" \ + --arch "${{ matrix.arch }}" \ + --build-type "${{ matrix.build_type }}" \ + build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1705610947..7496ccf388 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,7 @@ +--- name: CI +# yamllint disable-line rule:truthy on: push: branches: [dev, beta, release] @@ -10,6 +12,7 @@ permissions: contents: read concurrency: + # yamllint disable-line rule:line-length group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -73,6 +76,8 @@ jobs: name: Run script/clang-tidy for ESP32 IDF options: --environment esp32-idf-tidy --grep USE_ESP_IDF pio_cache_key: tidyesp32-idf + - id: yamllint + name: Run yamllint steps: - uses: actions/checkout@v3 @@ -80,17 +85,19 @@ jobs: uses: actions/setup-python@v4 id: python with: - python-version: '3.8' + python-version: "3.8" - name: Cache virtualenv uses: actions/cache@v3 with: path: .venv + # yamllint disable-line rule:line-length key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }} restore-keys: | venv-${{ steps.python.outputs.python-version }}- - name: Set up virtualenv + # yamllint disable rule:line-length run: | python -m venv .venv source .venv/bin/activate @@ -99,12 +106,14 @@ jobs: pip install -e . echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV + # yamllint enable rule:line-length # Use per check platformio cache because checks use different parts - name: Cache platformio uses: actions/cache@v3 with: path: ~/.platformio + # yamllint disable-line rule:line-length key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }} if: matrix.id == 'test' || matrix.id == 'clang-tidy' @@ -145,8 +154,9 @@ jobs: pytest -vv --tb=native tests if: matrix.id == 'pytest' - # Also run git-diff-index so that the step is marked as failed on formatting errors, - # since clang-format doesn't do anything but change files if -i is passed. + # Also run git-diff-index so that the step is marked as failed on + # formatting errors, since clang-format doesn't do anything but + # change files if -i is passed. - name: Run clang-format run: | script/clang-format -i @@ -161,6 +171,11 @@ jobs: # Also cache libdeps, store them in a ~/.platformio subfolder PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps + - name: Run yamllint + if: matrix.id == 'yamllint' + uses: frenck/action-yamllint@v1.2.0 + - name: Suggested changes run: script/ci-suggest-changes + # yamllint disable-line rule:line-length if: always() && (matrix.id == 'clang-tidy' || matrix.id == 'clang-format' || matrix.id == 'lint-python') diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index ceb45b2a91..1cf82895f3 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,8 +1,10 @@ +--- name: Lock +# yamllint disable-line rule:truthy on: schedule: - - cron: '30 0 * * *' + - cron: "30 0 * * *" workflow_dispatch: permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 216c094122..65d170f5d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,7 @@ +--- name: Publish Release +# yamllint disable-line rule:truthy on: workflow_dispatch: release: @@ -20,6 +22,7 @@ jobs: - uses: actions/checkout@v3 - name: Get tag id: tag + # yamllint disable rule:line-length run: | if [[ "$GITHUB_EVENT_NAME" = "release" ]]; then TAG="${GITHUB_REF#refs/tags/}" @@ -29,6 +32,7 @@ jobs: TAG="${TAG}${today}" fi echo "::set-output name=tag::${TAG}" + # yamllint enable rule:line-length deploy-pypi: name: Build and publish to PyPi @@ -39,7 +43,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Set up python environment run: | script/setup @@ -65,37 +69,37 @@ jobs: arch: [amd64, armv7, aarch64] build_type: ["ha-addon", "docker", "lint"] steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 - - name: Log in to docker hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Log in to the GitHub container registry - uses: docker/login-action@v2 - with: + - name: Log in to docker hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to the GitHub container registry + uses: docker/login-action@v2 + with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - run: | - docker/build.py \ - --tag "${{ needs.init.outputs.tag }}" \ - --arch "${{ matrix.arch }}" \ - --build-type "${{ matrix.build_type }}" \ - build \ - --push + - name: Build and push + run: | + docker/build.py \ + --tag "${{ needs.init.outputs.tag }}" \ + --arch "${{ matrix.arch }}" \ + --build-type "${{ matrix.build_type }}" \ + build \ + --push deploy-docker-manifest: if: github.repository == 'esphome/esphome' @@ -108,34 +112,34 @@ jobs: matrix: build_type: ["ha-addon", "docker", "lint"] steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Enable experimental manifest support - run: | - mkdir -p ~/.docker - echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: Enable experimental manifest support + run: | + mkdir -p ~/.docker + echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json - - name: Log in to docker hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Log in to the GitHub container registry - uses: docker/login-action@v2 - with: + - name: Log in to docker hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to the GitHub container registry + uses: docker/login-action@v2 + with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Run manifest - run: | - docker/build.py \ - --tag "${{ needs.init.outputs.tag }}" \ - --build-type "${{ matrix.build_type }}" \ - manifest + - name: Run manifest + run: | + docker/build.py \ + --tag "${{ needs.init.outputs.tag }}" \ + --build-type "${{ matrix.build_type }}" \ + manifest deploy-ha-addon-repo: if: github.repository == 'esphome/esphome' && github.event_name == 'release' @@ -144,6 +148,7 @@ jobs: steps: - env: TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} + # yamllint disable rule:line-length run: | TAG="${GITHUB_REF#refs/tags/}" curl \ @@ -152,3 +157,4 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \ -d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$TAG\"}}" + # yamllint enable rule:line-length diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b998043039..33f7ad041c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,8 +1,10 @@ +--- name: Stale +# yamllint disable-line rule:truthy on: schedule: - - cron: '30 0 * * *' + - cron: "30 0 * * *" workflow_dispatch: permissions: @@ -31,7 +33,8 @@ jobs: and will be closed if no further activity occurs within 7 days. Thank you for your contributions. - # Use stale to automatically close issues with a reference to the issue tracker + # Use stale to automatically close issues with a + # reference to the issue tracker close-issues: runs-on: ubuntu-latest steps: diff --git a/.gitpod.yml b/.gitpod.yml index e3f786a403..be2f11227c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,8 @@ +--- ports: -- port: 6052 - onOpen: open-preview + - port: 6052 + onOpen: open-preview tasks: -- before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup - command: python -m esphome dashboard config + # yamllint disable-line rule:line-length + - before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup + command: python -m esphome dashboard config diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95365ff5bb..083aea117d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,15 @@ +--- # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/ambv/black rev: 22.6.0 hooks: - - id: black - args: - - --safe - - --quiet - files: ^((esphome|script|tests)/.+)?[^/]+\.py$ + - id: black + args: + - --safe + - --quiet + files: ^((esphome|script|tests)/.+)?[^/]+\.py$ - repo: https://gitlab.com/pycqa/flake8 rev: 4.0.1 hooks: diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000..4fea263214 --- /dev/null +++ b/.yamllint @@ -0,0 +1,3 @@ +--- +ignore: | + venv/ diff --git a/tests/component_tests/binary_sensor/test_binary_sensor.yaml b/tests/component_tests/binary_sensor/test_binary_sensor.yaml index 912ae115eb..f98ce693f7 100644 --- a/tests/component_tests/binary_sensor/test_binary_sensor.yaml +++ b/tests/component_tests/binary_sensor/test_binary_sensor.yaml @@ -1,3 +1,4 @@ +--- esphome: name: test platform: ESP8266 @@ -6,13 +7,13 @@ esphome: binary_sensor: - platform: gpio id: bs_1 - name: "test bs1" + name: test bs1 internal: true pin: number: D0 - platform: gpio id: bs_2 - name: "test bs2" + name: test bs2 internal: false pin: number: D1 diff --git a/tests/component_tests/button/test_button.yaml b/tests/component_tests/button/test_button.yaml index 32d2e8d93b..48e13f0353 100644 --- a/tests/component_tests/button/test_button.yaml +++ b/tests/component_tests/button/test_button.yaml @@ -1,3 +1,4 @@ +--- esphome: name: test platform: ESP8266 diff --git a/tests/component_tests/deep_sleep/test_deep_sleep1.yaml b/tests/component_tests/deep_sleep/test_deep_sleep1.yaml index 18a425df58..96514a677f 100644 --- a/tests/component_tests/deep_sleep/test_deep_sleep1.yaml +++ b/tests/component_tests/deep_sleep/test_deep_sleep1.yaml @@ -1,3 +1,4 @@ +--- esphome: name: test platform: ESP32 diff --git a/tests/component_tests/deep_sleep/test_deep_sleep2.yaml b/tests/component_tests/deep_sleep/test_deep_sleep2.yaml index 49a7f510f2..0e8e598402 100644 --- a/tests/component_tests/deep_sleep/test_deep_sleep2.yaml +++ b/tests/component_tests/deep_sleep/test_deep_sleep2.yaml @@ -1,3 +1,4 @@ +--- esphome: name: test platform: ESP32 diff --git a/tests/component_tests/sensor/test_sensor.yaml b/tests/component_tests/sensor/test_sensor.yaml index a38dd14041..8c0fd85b17 100644 --- a/tests/component_tests/sensor/test_sensor.yaml +++ b/tests/component_tests/sensor/test_sensor.yaml @@ -1,3 +1,4 @@ +--- esphome: name: test platform: ESP8266 @@ -7,6 +8,6 @@ sensor: - platform: adc pin: A0 id: s_1 - name: "test s1" + name: test s1 update_interval: 60s - device_class: "voltage" + device_class: voltage diff --git a/tests/test1.yaml b/tests/test1.yaml index 1a9d69eac8..274b25548b 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -1,3 +1,4 @@ +--- substitutions: devicename: test1 sensorname: my @@ -43,13 +44,13 @@ esphome: json: key: !lambda |- return id(${textname}_text).state; - greeting: "Hello World" + greeting: Hello World - http_request.send: method: PUT url: https://esphome.io headers: Content-Type: application/json - body: "Some data" + body: Some data verify_ssl: false on_response: then: @@ -95,8 +96,8 @@ mqtt: password: "debug" client_id: someclient use_abbreviations: false - discovery: True - discovery_retain: False + discovery: true + discovery_retain: false discovery_prefix: discovery discovery_unique_id_generator: legacy topic_prefix: helloworld @@ -109,7 +110,7 @@ mqtt: topic: topic/to/send/to payload: hi qos: 2 - retain: True + retain: true keepalive: 60s reboot_timeout: 60s on_message: @@ -154,6 +155,7 @@ mqtt: return effect; - light.control: id: ${roomname}_lights + # yamllint disable-line rule:line-length brightness: !lambda "return id(${roomname}_lights).current_values.get_brightness() + 0.5;" - light.dim_relative: id: ${roomname}_lights @@ -179,7 +181,7 @@ mqtt: i2c: sda: 21 scl: 22 - scan: True + scan: true frequency: 100kHz setup_priority: -100 id: i2c_bus @@ -192,10 +194,10 @@ spi: uart: - tx_pin: number: GPIO22 - inverted: yes + inverted: true rx_pin: number: GPIO23 - inverted: yes + inverted: true baud_rate: 115200 id: uart0 parity: NONE @@ -222,7 +224,7 @@ uart: rx_buffer_size: 1024 ota: - safe_mode: True + safe_mode: true password: "superlongpasswordthatnoonewillknow" port: 3286 reboot_timeout: 2min @@ -233,14 +235,14 @@ ota: ESP_LOGD("ota", "State %d", state); on_begin: then: - logger.log: "OTA begin" + logger.log: OTA begin on_progress: then: lambda: >- ESP_LOGD("ota", "Got progress %f", x); on_end: then: - logger.log: "OTA end" + logger.log: OTA end on_error: then: lambda: >- @@ -258,7 +260,7 @@ web_server: version: 2 power_supply: - id: "atx_power_supply" + id: atx_power_supply enable_time: 20ms keep_on_time: 10s pin: @@ -308,22 +310,22 @@ bedjet: id: my_bedjet_client time_id: sntp_time mcp23s08: - - id: "mcp23s08_hub" + - id: mcp23s08_hub cs_pin: GPIO12 deviceaddress: 0 mcp23s17: - - id: "mcp23s17_hub" + - id: mcp23s17_hub cs_pin: GPIO12 deviceaddress: 1 sensor: - platform: ble_client ble_client_id: ble_foo - name: "Green iTag btn" - service_uuid: "ffe0" - characteristic_uuid: "ffe1" - descriptor_uuid: "ffe2" + name: Green iTag btn + service_uuid: ffe0 + characteristic_uuid: ffe1 + descriptor_uuid: ffe2 notify: true update_interval: never lambda: |- @@ -335,7 +337,7 @@ sensor: ESP_LOGD("green_btn", "Button was pressed, val%f", x); - platform: adc pin: A0 - name: "Living Room Brightness" + name: Living Room Brightness update_interval: "1:01" attenuation: 2.5db unit_of_measurement: "°C" @@ -384,11 +386,13 @@ sensor: - lambda: return x * (9.0/5.0) + 32.0; on_value: then: + # yamllint disable rule:line-length - lambda: |- ESP_LOGD("main", "Got value %f", x); id(${sensorname}_sensor).publish_state(42.0); ESP_LOGI("main", "Value of my sensor: %f", id(${sensorname}_sensor).state); ESP_LOGI("main", "Raw Value of my sensor: %f", id(${sensorname}_sensor).state); + # yamllint enable rule:line-length on_value_range: above: 5 below: 10 @@ -405,18 +409,18 @@ sensor: ESP_LOGD("main", "Got raw value %f", x); - logger.log: level: DEBUG - format: "Got raw value %f" + format: Got raw value %f args: ["x"] - - logger.log: "Got raw value NAN" + - logger.log: Got raw value NAN - mqtt.publish: topic: some/topic payload: Hello qos: 2 - retain: True + retain: true - platform: esp32_hall name: ESP32 Hall Sensor - platform: ads1115 - multiplexer: "A0_A1" + multiplexer: A0_A1 gain: 1.024 id: ${sensorname}_sensor filters: @@ -427,57 +431,57 @@ sensor: cs_pin: 5 phase_a: voltage: - name: "EMON Line Voltage A" + name: EMON Line Voltage A current: - name: "EMON CT1 Current" + name: EMON CT1 Current power: - name: "EMON Active Power CT1" + name: EMON Active Power CT1 reactive_power: - name: "EMON Reactive Power CT1" + name: EMON Reactive Power CT1 power_factor: - name: "EMON Power Factor CT1" + name: EMON Power Factor CT1 gain_voltage: 7305 gain_ct: 27961 phase_b: current: - name: "EMON CT2 Current" + name: EMON CT2 Current power: - name: "EMON Active Power CT2" + name: EMON Active Power CT2 reactive_power: - name: "EMON Reactive Power CT2" + name: EMON Reactive Power CT2 power_factor: - name: "EMON Power Factor CT2" + name: EMON Power Factor CT2 gain_voltage: 7305 gain_ct: 27961 phase_c: current: - name: "EMON CT3 Current" + name: EMON CT3 Current power: - name: "EMON Active Power CT3" + name: EMON Active Power CT3 reactive_power: - name: "EMON Reactive Power CT3" + name: EMON Reactive Power CT3 power_factor: - name: "EMON Power Factor CT3" + name: EMON Power Factor CT3 gain_voltage: 7305 gain_ct: 27961 frequency: - name: "EMON Line Frequency" + name: EMON Line Frequency chip_temperature: - name: "EMON Chip Temp A" + name: EMON Chip Temp A line_frequency: 60Hz current_phases: 3 gain_pga: 2X - platform: bh1750 - name: "Living Room Brightness 3" + name: Living Room Brightness 3 internal: true address: 0x23 update_interval: 30s - retain: False + retain: false availability: state_topic: livingroom/custom_state_topic i2c_id: i2c_bus - platform: max44009 - name: "Outside Brightness 1" + name: Outside Brightness 1 internal: true address: 0x4A update_interval: 30s @@ -485,13 +489,13 @@ sensor: i2c_id: i2c_bus - platform: bme280 temperature: - name: "Outside Temperature" + name: Outside Temperature oversampling: 16x pressure: - name: "Outside Pressure" + name: Outside Pressure oversampling: none humidity: - name: "Outside Humidity" + name: Outside Humidity oversampling: 8x address: 0x77 iir_filter: 16x @@ -499,14 +503,14 @@ sensor: i2c_id: i2c_bus - platform: bme680 temperature: - name: "Outside Temperature" + name: Outside Temperature oversampling: 16x pressure: - name: "Outside Pressure" + name: Outside Pressure humidity: - name: "Outside Humidity" + name: Outside Humidity gas_resistance: - name: "Outside Gas Sensor" + name: Outside Gas Sensor address: 0x77 heater: temperature: 320 @@ -515,9 +519,9 @@ sensor: i2c_id: i2c_bus - platform: bmp085 temperature: - name: "Outside Temperature" + name: Outside Temperature pressure: - name: "Outside Pressure" + name: Outside Pressure filters: - lambda: >- return x / powf(1.0 - (x / 44330.0), 5.255); @@ -525,54 +529,54 @@ sensor: i2c_id: i2c_bus - platform: bmp280 temperature: - name: "Outside Temperature" + name: Outside Temperature oversampling: 16x pressure: - name: "Outside Pressure" + name: Outside Pressure address: 0x77 update_interval: 15s iir_filter: 16x i2c_id: i2c_bus - platform: dallas address: 0x1C0000031EDD2A28 - name: "Living Room Temperature" + name: Living Room Temperature resolution: 9 - platform: dallas index: 1 - name: "Living Room Temperature 2" + name: Living Room Temperature 2 - platform: dht pin: GPIO26 temperature: - name: "Living Room Temperature 3" + name: Living Room Temperature 3 humidity: - name: "Living Room Humidity 3" + name: Living Room Humidity 3 model: AM2302 update_interval: 15s - platform: dht12 temperature: - name: "Living Room Temperature 4" + name: Living Room Temperature 4 humidity: - name: "Living Room Humidity 4" + name: Living Room Humidity 4 update_interval: 15s i2c_id: i2c_bus - platform: duty_cycle pin: GPIO25 name: Duty Cycle Sensor - platform: esp32_hall - name: "ESP32 Hall Sensor" + name: ESP32 Hall Sensor update_interval: 15s - platform: ens210 temperature: - name: "Living Room Temperature 5" + name: Living Room Temperature 5 humidity: - name: 'Living Room Humidity 5' + name: Living Room Humidity 5 update_interval: 15s i2c_id: i2c_bus - platform: hdc1080 temperature: - name: 'Living Room Temperature 6' + name: Living Room Temperature 6 humidity: - name: 'Living Room Humidity 5' + name: Living Room Humidity 5 update_interval: 15s i2c_id: i2c_bus - platform: hlw8012 @@ -580,14 +584,14 @@ sensor: cf_pin: 14 cf1_pin: 13 current: - name: "HLW8012 Current" + name: HLW8012 Current voltage: - name: "HLW8012 Voltage" + name: HLW8012 Voltage power: - name: "HLW8012 Power" + name: HLW8012 Power id: hlw8012_power energy: - name: "HLW8012 Energy" + name: HLW8012 Energy id: hlw8012_energy update_interval: 15s current_resistor: 0.001 ohm @@ -597,53 +601,53 @@ sensor: model: hlw8012 - platform: total_daily_energy power_id: hlw8012_power - name: "HLW8012 Total Daily Energy" + name: HLW8012 Total Daily Energy - platform: integration sensor: hlw8012_power - name: "Integration Sensor" + name: Integration Sensor time_unit: s - platform: integration sensor: hlw8012_power - name: "Integration Sensor lazy" + name: Integration Sensor lazy time_unit: s - platform: hmc5883l address: 0x68 field_strength_x: - name: "HMC5883L Field Strength X" + name: HMC5883L Field Strength X field_strength_y: - name: "HMC5883L Field Strength Y" + name: HMC5883L Field Strength Y field_strength_z: - name: "HMC5883L Field Strength Z" + name: HMC5883L Field Strength Z heading: - name: "HMC5883L Heading" + name: HMC5883L Heading range: 130uT oversampling: 8x update_interval: 15s i2c_id: i2c_bus - platform: honeywellabp pressure: - name: "Honeywell pressure" + name: Honeywell pressure min_pressure: 0 max_pressure: 15 temperature: - name: "Honeywell temperature" + name: Honeywell temperature cs_pin: GPIO5 - platform: qmc5883l address: 0x0D field_strength_x: - name: "QMC5883L Field Strength X" + name: QMC5883L Field Strength X field_strength_y: - name: "QMC5883L Field Strength Y" + name: QMC5883L Field Strength Y field_strength_z: - name: "QMC5883L Field Strength Z" + name: QMC5883L Field Strength Z heading: - name: "QMC5883L Heading" + name: QMC5883L Heading range: 800uT oversampling: 256x update_interval: 15s i2c_id: i2c_bus - platform: hx711 - name: "HX711 Value" + name: HX711 Value dout_pin: GPIO23 clk_pin: GPIO25 gain: 128 @@ -652,13 +656,13 @@ sensor: address: 0x40 shunt_resistance: 0.1 ohm current: - name: "INA219 Current" + name: INA219 Current power: - name: "INA219 Power" + name: INA219 Power bus_voltage: - name: "INA219 Bus Voltage" + name: INA219 Bus Voltage shunt_voltage: - name: "INA219 Shunt Voltage" + name: INA219 Shunt Voltage max_voltage: 32.0V max_current: 3.2A update_interval: 15s @@ -667,13 +671,13 @@ sensor: address: 0x40 shunt_resistance: 0.1 ohm current: - name: "INA226 Current" + name: INA226 Current power: - name: "INA226 Power" + name: INA226 Power bus_voltage: - name: "INA226 Bus Voltage" + name: INA226 Bus Voltage shunt_voltage: - name: "INA226 Shunt Voltage" + name: INA226 Shunt Voltage max_current: 3.2A update_interval: 15s i2c_id: i2c_bus @@ -682,17 +686,17 @@ sensor: channel_1: shunt_resistance: 0.1 ohm current: - name: "INA3221 Channel 1 Current" + name: INA3221 Channel 1 Current power: - name: "INA3221 Channel 1 Power" + name: INA3221 Channel 1 Power bus_voltage: - name: "INA3221 Channel 1 Bus Voltage" + name: INA3221 Channel 1 Bus Voltage shunt_voltage: - name: "INA3221 Channel 1 Shunt Voltage" + name: INA3221 Channel 1 Shunt Voltage update_interval: 15s i2c_id: i2c_bus - platform: kalman_combinator - name: "Kalman-filtered temperature" + name: Kalman-filtered temperature process_std_dev: 0.00139 sources: - source: scd30_temperature @@ -702,114 +706,114 @@ sensor: error: 1.5 - platform: htu21d temperature: - name: "Living Room Temperature 6" + name: Living Room Temperature 6 humidity: - name: "Living Room Humidity 6" + name: Living Room Humidity 6 update_interval: 15s i2c_id: i2c_bus - platform: max6675 - name: "Living Room Temperature" + name: Living Room Temperature cs_pin: GPIO23 update_interval: 15s - platform: max31855 - name: "Den Temperature" + name: Den Temperature cs_pin: GPIO23 update_interval: 15s reference_temperature: - name: "MAX31855 Internal Temperature" + name: MAX31855 Internal Temperature - platform: max31856 - name: "BBQ Temperature" + name: BBQ Temperature cs_pin: GPIO17 update_interval: 15s mains_filter: 50Hz - platform: max31865 - name: "Water Tank Temperature" + name: Water Tank Temperature cs_pin: GPIO23 update_interval: 15s - reference_resistance: "430 Ω" - rtd_nominal_resistance: "100 Ω" + reference_resistance: 430 Ω + rtd_nominal_resistance: 100 Ω - platform: mhz19 uart_id: uart0 co2: - name: "MH-Z19 CO2 Value" + name: MH-Z19 CO2 Value temperature: - name: "MH-Z19 Temperature" + name: MH-Z19 Temperature update_interval: 15s automatic_baseline_calibration: false - platform: mpu6050 address: 0x68 accel_x: - name: "MPU6050 Accel X" + name: MPU6050 Accel X accel_y: - name: "MPU6050 Accel Y" + name: MPU6050 Accel Y accel_z: - name: "MPU6050 Accel z" + name: MPU6050 Accel z gyro_x: - name: "MPU6050 Gyro X" + name: MPU6050 Gyro X gyro_y: - name: "MPU6050 Gyro Y" + name: MPU6050 Gyro Y gyro_z: - name: "MPU6050 Gyro z" + name: MPU6050 Gyro z temperature: - name: "MPU6050 Temperature" + name: MPU6050 Temperature i2c_id: i2c_bus - platform: mpu6886 address: 0x68 accel_x: - name: "MPU6886 Accel X" + name: MPU6886 Accel X accel_y: - name: "MPU6886 Accel Y" + name: MPU6886 Accel Y accel_z: - name: "MPU6886 Accel z" + name: MPU6886 Accel z gyro_x: - name: "MPU6886 Gyro X" + name: MPU6886 Gyro X gyro_y: - name: "MPU6886 Gyro Y" + name: MPU6886 Gyro Y gyro_z: - name: "MPU6886 Gyro z" + name: MPU6886 Gyro z temperature: - name: "MPU6886 Temperature" + name: MPU6886 Temperature i2c_id: i2c_bus - platform: dps310 temperature: - name: "DPS310 Temperature" + name: DPS310 Temperature pressure: - name: "DPS310 Pressure" + name: DPS310 Pressure address: 0x77 update_interval: 15s i2c_id: i2c_bus - platform: ms5611 temperature: - name: "Outside Temperature" + name: Outside Temperature pressure: - name: "Outside Pressure" + name: Outside Pressure address: 0x77 update_interval: 15s i2c_id: i2c_bus - platform: pmsa003i pm_1_0: - name: "PMSA003i PM1.0" + name: PMSA003i PM1.0 pm_2_5: - name: "PMSA003i PM2.5" + name: PMSA003i PM2.5 pm_10_0: - name: "PMSA003i PM10.0" + name: PMSA003i PM10.0 pmc_0_3: - name: "PMSA003i PMC <0.3µm" + name: PMSA003i PMC <0.3µm pmc_0_5: - name: "PMSA003i PMC <0.5µm" + name: PMSA003i PMC <0.5µm pmc_1_0: - name: "PMSA003i PMC <1µm" + name: PMSA003i PMC <1µm pmc_2_5: - name: "PMSA003i PMC <2.5µm" + name: PMSA003i PMC <2.5µm pmc_5_0: - name: "PMSA003i PMC <5µm" + name: PMSA003i PMC <5µm pmc_10_0: - name: "PMSA003i PMC <10µm" + name: PMSA003i PMC <10µm address: 0x12 - standard_units: True + standard_units: true i2c_id: i2c_bus - platform: pulse_counter - name: "Pulse Counter" + name: Pulse Counter pin: GPIO12 count_mode: rising_edge: INCREMENT @@ -817,7 +821,7 @@ sensor: internal_filter: 13us update_interval: 15s - platform: pulse_meter - name: "Pulse Meter" + name: Pulse Meter id: pulse_meter_sensor pin: GPIO12 internal_filter: 100ms @@ -827,20 +831,20 @@ sensor: id: pulse_meter_sensor value: 12345 total: - name: "Pulse Meter Total" + name: Pulse Meter Total - platform: qmp6988 temperature: - name: "Living Temperature QMP" + name: Living Temperature QMP oversampling: 32x pressure: - name: "Living Pressure QMP" + name: Living Pressure QMP oversampling: 2x address: 0x70 update_interval: 30s iir_filter: 16x i2c_id: i2c_bus - platform: rotary_encoder - name: "Rotary Encoder" + name: Rotary Encoder id: rotary_encoder1 pin_a: GPIO23 pin_b: GPIO25 @@ -860,49 +864,49 @@ sensor: id: rotary_encoder1 value: !lambda "return -1;" on_clockwise: - - logger.log: "Clockwise" + - logger.log: Clockwise on_anticlockwise: - - logger.log: "Anticlockwise" + - logger.log: Anticlockwise - platform: pulse_width name: Pulse Width pin: GPIO12 - platform: sm300d2 uart_id: uart0 co2: - name: "SM300D2 CO2 Value" + name: SM300D2 CO2 Value formaldehyde: - name: "SM300D2 Formaldehyde Value" + name: SM300D2 Formaldehyde Value tvoc: - name: "SM300D2 TVOC Value" + name: SM300D2 TVOC Value pm_2_5: - name: "SM300D2 PM2.5 Value" + name: SM300D2 PM2.5 Value pm_10_0: - name: "SM300D2 PM10 Value" + name: SM300D2 PM10 Value temperature: - name: "SM300D2 Temperature Value" + name: SM300D2 Temperature Value humidity: - name: "SM300D2 Humidity Value" + name: SM300D2 Humidity Value update_interval: 60s - platform: sht3xd temperature: - name: "Living Room Temperature 8" + name: Living Room Temperature 8 humidity: - name: "Living Room Humidity 8" + name: Living Room Humidity 8 address: 0x44 i2c_id: i2c_bus update_interval: 15s - platform: sts3x - name: "Living Room Temperature 9" + name: Living Room Temperature 9 address: 0x4A i2c_id: i2c_bus - platform: scd30 co2: - name: "Living Room CO2 9" + name: Living Room CO2 9 temperature: id: scd30_temperature - name: "Living Room Temperature 9" + name: Living Room Temperature 9 humidity: - name: "Living Room Humidity 9" + name: Living Room Humidity 9 address: 0x61 update_interval: 15s automatic_self_calibration: true @@ -913,12 +917,12 @@ sensor: - platform: scd4x id: scd40 co2: - name: "SCD4X CO2" + name: SCD4X CO2 temperature: id: scd4x_temperature - name: "SCD4X Temperature" + name: SCD4X Temperature humidity: - name: "SCD4X Humidity" + name: SCD4X Humidity update_interval: 15s automatic_self_calibration: true altitude_compensation: 10m @@ -927,63 +931,63 @@ sensor: i2c_id: i2c_bus - platform: sgp30 eco2: - name: "Workshop eCO2" + name: Workshop eCO2 accuracy_decimals: 1 tvoc: - name: "Workshop TVOC" + name: Workshop TVOC accuracy_decimals: 1 address: 0x58 update_interval: 5s i2c_id: i2c_bus - platform: sps30 pm_1_0: - name: "Workshop PM <1µm Weight concentration" - id: "workshop_PM_1_0" + name: Workshop PM <1µm Weight concentration + id: workshop_PM_1_0 pm_2_5: - name: "Workshop PM <2.5µm Weight concentration" - id: "workshop_PM_2_5" + name: Workshop PM <2.5µm Weight concentration + id: workshop_PM_2_5 pm_4_0: - name: "Workshop PM <4µm Weight concentration" - id: "workshop_PM_4_0" + name: Workshop PM <4µm Weight concentration + id: workshop_PM_4_0 pm_10_0: - name: "Workshop PM <10µm Weight concentration" - id: "workshop_PM_10_0" + name: Workshop PM <10µm Weight concentration + id: workshop_PM_10_0 pmc_0_5: - name: "Workshop PM <0.5µm Number concentration" - id: "workshop_PMC_0_5" + name: Workshop PM <0.5µm Number concentration + id: workshop_PMC_0_5 pmc_1_0: - name: "Workshop PM <1µm Number concentration" - id: "workshop_PMC_1_0" + name: Workshop PM <1µm Number concentration + id: workshop_PMC_1_0 pmc_2_5: - name: "Workshop PM <2.5µm Number concentration" - id: "workshop_PMC_2_5" + name: Workshop PM <2.5µm Number concentration + id: workshop_PMC_2_5 pmc_4_0: - name: "Workshop PM <4µm Number concentration" - id: "workshop_PMC_4_0" + name: Workshop PM <4µm Number concentration + id: workshop_PMC_4_0 pmc_10_0: - name: "Workshop PM <10µm Number concentration" - id: "workshop_PMC_10_0" + name: Workshop PM <10µm Number concentration + id: workshop_PMC_10_0 address: 0x69 update_interval: 10s i2c_id: i2c_bus - platform: sht4x temperature: - name: "SHT4X Temperature" + name: SHT4X Temperature humidity: - name: "SHT4X Humidity" + name: SHT4X Humidity address: 0x44 update_interval: 15s i2c_id: i2c_bus - platform: shtcx temperature: - name: "Living Room Temperature 10" + name: Living Room Temperature 10 humidity: - name: "Living Room Humidity 10" + name: Living Room Humidity 10 address: 0x70 update_interval: 15s i2c_id: i2c_bus - platform: template - name: "Template Sensor" + name: Template Sensor state_class: measurement id: template_sensor lambda: |- @@ -1001,7 +1005,7 @@ sensor: id: template_sensor state: !lambda "return NAN;" - platform: tsl2561 - name: "TSL2561 Ambient Light" + name: TSL2561 Ambient Light address: 0x39 update_interval: 15s is_cs_package: true @@ -1015,17 +1019,17 @@ sensor: integration_time: 600ms gain: high visible: - name: "tsl2591 visible" + name: tsl2591 visible id: tsl2591_vis - unit_of_measurement: "pH" + unit_of_measurement: pH infrared: - name: "tsl2591 infrared" + name: tsl2591 infrared id: tsl2591_ir full_spectrum: - name: "tsl2591 full_spectrum" + name: tsl2591 full_spectrum id: tsl2591_fs calculated_lux: - name: "tsl2591 calculated_lux" + name: tsl2591 calculated_lux id: tsl2591_cl i2c_id: i2c_bus - platform: ultrasonic @@ -1033,17 +1037,17 @@ sensor: echo_pin: number: GPIO23 inverted: true - name: "Ultrasonic Sensor" + name: Ultrasonic Sensor timeout: 5.5m id: ultrasonic_sensor1 - platform: uptime name: Uptime Sensor - platform: wifi_signal - name: "WiFi Signal Sensor" + name: WiFi Signal Sensor update_interval: 15s - platform: mqtt_subscribe - name: "MQTT Subscribe Sensor 1" - topic: "mqtt/topic" + name: MQTT Subscribe Sensor 1 + topic: mqtt/topic id: the_sensor qos: 2 on_value: @@ -1055,9 +1059,9 @@ sensor: - platform: sds011 uart_id: uart0 pm_2_5: - name: "SDS011 PM2.5" + name: SDS011 PM2.5 pm_10_0: - name: "SDS011 PM10.0" + name: SDS011 PM10.0 update_interval: 5min rx_only: false - platform: ccs811 @@ -1070,9 +1074,9 @@ sensor: i2c_id: i2c_bus - platform: tx20 wind_speed: - name: "Windspeed" + name: Windspeed wind_direction_degrees: - name: "Winddirection Degrees" + name: Winddirection Degrees pin: number: GPIO04 mode: INPUT @@ -1080,48 +1084,48 @@ sensor: clock_pin: GPIO5 data_pin: GPIO4 co2: - name: "ZyAura CO2" + name: ZyAura CO2 temperature: - name: "ZyAura Temperature" + name: ZyAura Temperature humidity: - name: "ZyAura Humidity" + name: ZyAura Humidity - platform: as3935 lightning_energy: - name: "Lightning Energy" + name: Lightning Energy distance: - name: "Distance Storm" + name: Distance Storm - platform: tmp117 - name: "TMP117 Temperature" + name: TMP117 Temperature update_interval: 5s i2c_id: i2c_bus - platform: hm3301 pm_1_0: - name: "PM1.0" + name: PM1.0 pm_2_5: - name: "PM2.5" + name: PM2.5 pm_10_0: - name: "PM10.0" + name: PM10.0 aqi: - name: "AQI" - calculation_type: "CAQI" + name: AQI + calculation_type: CAQI i2c_id: i2c_bus - platform: teleinfo - tag_name: "HCHC" - name: "hchc" - unit_of_measurement: "Wh" + tag_name: HCHC + name: hchc + unit_of_measurement: Wh icon: mdi:flash teleinfo_id: myteleinfo - platform: mcp9808 - name: "MCP9808 Temperature" + name: MCP9808 Temperature update_interval: 15s i2c_id: i2c_bus - platform: ezo id: ph_ezo address: 99 - unit_of_measurement: "pH" + unit_of_measurement: pH i2c_id: i2c_bus - platform: sdp3x - name: "HVAC Filter Pressure drop" + name: HVAC Filter Pressure drop id: filter_pressure update_interval: 5s accuracy_decimals: 3 @@ -1129,11 +1133,11 @@ sensor: - platform: cs5460a id: cs5460a1 current: - name: "Socket current" + name: Socket current voltage: - name: "Mains voltage" + name: Mains voltage power: - name: "Socket power" + name: Socket power on_value: then: cs5460a.restart: cs5460a1 @@ -1141,8 +1145,8 @@ sensor: pga_gain: 10X current_gain: 0.01 voltage_gain: 0.000573 - current_hpf: on - voltage_hpf: on + current_hpf: true + voltage_hpf: true phase_offset: 20 pulse_energy: 0.01 kWh cs_pin: @@ -1151,7 +1155,7 @@ sensor: - platform: max9611 i2c_id: i2c_bus shunt_resistance: 0.2 ohm - gain: "1X" + gain: 1X voltage: name: Max9611 Voltage current: @@ -1163,7 +1167,7 @@ sensor: update_interval: 1s esp32_touch: - setup_mode: False + setup_mode: false iir_filter: 10ms sleep_duration: 27ms measurement_duration: 8ms @@ -1180,7 +1184,7 @@ binary_sensor: number: 1 # One of INPUT or INPUT_PULLUP mode: INPUT_PULLUP - inverted: False + inverted: false - platform: gpio name: "MCP23S17 Pin #1" pin: @@ -1189,7 +1193,7 @@ binary_sensor: number: 1 # One of INPUT or INPUT_PULLUP mode: INPUT_PULLUP - inverted: False + inverted: false - platform: gpio name: "MCP23S17 Pin #1 with interrupt" pin: @@ -1198,11 +1202,11 @@ binary_sensor: number: 1 # One of INPUT or INPUT_PULLUP mode: INPUT_PULLUP - inverted: False + inverted: false interrupt: FALLING - platform: gpio pin: GPIO9 - name: "Living Room Window" + name: Living Room Window device_class: window filters: - invert: @@ -1242,7 +1246,7 @@ binary_sensor: - OFF for at least 0.2s then: - logger.log: - format: "Multi Clicked TWO" + format: Multi Clicked TWO level: warn - timing: - OFF for 1s to 2s @@ -1250,30 +1254,30 @@ binary_sensor: - OFF for at least 0.5s then: - logger.log: - format: "Multi Clicked LONG SINGLE" + format: Multi Clicked LONG SINGLE level: warn - timing: - ON for at most 1s - OFF for at least 0.5s then: - logger.log: - format: "Multi Clicked SINGLE" + format: Multi Clicked SINGLE level: warn id: binary_sensor1 - platform: gpio pin: number: GPIO9 mode: INPUT_PULLUP - name: "Living Room Window 2" + name: Living Room Window 2 - platform: status - name: "Living Room Status" + name: Living Room Status - platform: esp32_touch - name: "ESP32 Touch Pad GPIO27" + name: ESP32 Touch Pad GPIO27 pin: GPIO27 threshold: 1000 id: btn_left - platform: template - name: "Garage Door Open" + name: Garage Door Open id: garage_door lambda: |- if (isnan(id(${sensorname}_sensor).state)) { @@ -1291,7 +1295,7 @@ binary_sensor: on_press: - binary_sensor.template.publish: id: garage_door - state: OFF + state: false - output.ledc.set_frequency: id: gpio_19 frequency: 500.0Hz @@ -1301,41 +1305,41 @@ binary_sensor: - platform: pn532 pn532_id: pn532_bs uid: 74-10-37-94 - name: "PN532 NFC Tag" + name: PN532 NFC Tag - platform: rdm6300 uid: 7616525 - name: "RDM6300 NFC Tag" + name: RDM6300 NFC Tag - platform: gpio - name: "PCF binary sensor" + name: PCF binary sensor pin: pcf8574: pcf8574_hub number: 1 mode: INPUT - inverted: True + inverted: true - platform: gpio - name: "MCP21 binary sensor" + name: MCP21 binary sensor pin: mcp23xxx: mcp23017_hub number: 1 mode: INPUT - inverted: True + inverted: true - platform: gpio - name: "MCP22 binary sensor" + name: MCP22 binary sensor pin: mcp23xxx: mcp23008_hub number: 7 mode: INPUT_PULLUP - inverted: False + inverted: false - platform: gpio - name: "MCP23 binary sensor" + name: MCP23 binary sensor pin: mcp23016: mcp23016_hub number: 7 mode: INPUT - inverted: False + inverted: false - platform: remote_receiver - name: "Raw Remote Receiver Test" + name: Raw Remote Receiver Test raw: code: [ @@ -1376,7 +1380,7 @@ binary_sensor: 1709, ] - platform: as3935 - name: "Storm Alert" + name: Storm Alert - platform: analog_threshold name: Analog Trheshold 1 sensor_id: template_sensor @@ -1434,7 +1438,7 @@ output: pin: GPIO26 id: gpio_26 power_supply: atx_power_supply - inverted: False + inverted: false - platform: ledc pin: 19 id: gpio_19 @@ -1468,67 +1472,67 @@ output: - platform: tlc59208f id: tlc_0 channel: 0 - tlc59208f_id: "tlc59208f_1" + tlc59208f_id: tlc59208f_1 - platform: tlc59208f id: tlc_1 channel: 1 - tlc59208f_id: "tlc59208f_1" + tlc59208f_id: tlc59208f_1 - platform: tlc59208f id: tlc_2 channel: 2 - tlc59208f_id: "tlc59208f_1" + tlc59208f_id: tlc59208f_1 - platform: tlc59208f id: tlc_3 channel: 0 - tlc59208f_id: "tlc59208f_2" + tlc59208f_id: tlc59208f_2 - platform: tlc59208f id: tlc_4 channel: 1 - tlc59208f_id: "tlc59208f_2" + tlc59208f_id: tlc59208f_2 - platform: tlc59208f id: tlc_5 channel: 2 - tlc59208f_id: "tlc59208f_2" + tlc59208f_id: tlc59208f_2 - platform: tlc59208f id: tlc_6 channel: 0 - tlc59208f_id: "tlc59208f_3" + tlc59208f_id: tlc59208f_3 - platform: tlc59208f id: tlc_7 channel: 1 - tlc59208f_id: "tlc59208f_3" + tlc59208f_id: tlc59208f_3 - platform: tlc59208f id: tlc_8 channel: 2 - tlc59208f_id: "tlc59208f_3" + tlc59208f_id: tlc59208f_3 - platform: gpio id: id2 pin: pcf8574: pcf8574_hub number: 0 mode: OUTPUT - inverted: False + inverted: false - platform: gpio id: id22 pin: mcp23xxx: mcp23017_hub number: 0 mode: OUTPUT - inverted: False + inverted: false - platform: gpio id: id23 pin: mcp23xxx: mcp23008_hub number: 0 mode: OUTPUT - inverted: False + inverted: false - platform: gpio id: id25 pin: mcp23016: mcp23016_hub number: 0 mode: OUTPUT - inverted: False + inverted: false - platform: my9231 id: my_0 channel: 0 @@ -1588,27 +1592,27 @@ e131: light: - platform: binary - name: "Desk Lamp" + name: Desk Lamp output: gpio_26 effects: - strobe: - strobe: - name: "My Strobe" + name: My Strobe colors: - - state: True + - state: true duration: 250ms - - state: False + - state: false duration: 250ms on_turn_on: - switch.template.publish: id: livingroom_lights - state: yes + state: true on_turn_off: - switch.template.publish: id: livingroom_lights - state: yes + state: true - platform: monochromatic - name: "Kitchen Lights" + name: Kitchen Lights id: kitchen output: gpio_19 gamma_correct: 2.8 @@ -1617,7 +1621,7 @@ light: - strobe: - flicker: - flicker: - name: "My Flicker" + name: My Flicker alpha: 98% intensity: 1.5% - lambda: @@ -1629,20 +1633,20 @@ light: if (state == 4) state = 0; - platform: rgb - name: "Living Room Lights" + name: Living Room Lights id: ${roomname}_lights red: pca_0 green: pca_1 blue: pca_2 - platform: rgbw - name: "Living Room Lights 2" + name: Living Room Lights 2 red: pca_3 green: pca_4 blue: pca_5 white: pca_6 color_interlock: true - platform: rgbww - name: "Living Room Lights 2" + name: Living Room Lights 2 red: pca_3 green: pca_4 blue: pca_5 @@ -1652,7 +1656,7 @@ light: warm_white_color_temperature: 500 mireds color_interlock: true - platform: rgbct - name: "Living Room Lights 2" + name: Living Room Lights 2 red: pca_3 green: pca_4 blue: pca_5 @@ -1662,14 +1666,14 @@ light: warm_white_color_temperature: 500 mireds color_interlock: true - platform: cwww - name: "Living Room Lights 2" + name: Living Room Lights 2 cold_white: pca_6 warm_white: pca_6 cold_white_color_temperature: 153 mireds warm_white_color_temperature: 500 mireds constant_brightness: true - platform: color_temperature - name: "Living Room Lights 2" + name: Living Room Lights 2 color_temperature: pca_6 brightness: pca_6 cold_white_color_temperature: 153 mireds @@ -1683,7 +1687,7 @@ light: max_refresh_rate: 20ms power_supply: atx_power_supply color_correct: [75%, 100%, 50%] - name: "FastLED WS2811 Light" + name: FastLED WS2811 Light effects: - addressable_color_wipe: - addressable_color_wipe: @@ -1698,7 +1702,7 @@ light: blue: 0% num_leds: 1 add_led_interval: 100ms - reverse: False + reverse: false - addressable_scan: - addressable_scan: name: Scan Effect With Custom Values @@ -1726,7 +1730,7 @@ light: update_interval: 16ms intensity: 5% - addressable_lambda: - name: "Test For Custom Lambda Effect" + name: Test For Custom Lambda Effect lambda: |- if (initial_run) { it[0] = current_color; @@ -1762,10 +1766,10 @@ light: data_rate: 2MHz num_leds: 60 rgb_order: BRG - name: "FastLED SPI Light" + name: FastLED SPI Light - platform: neopixelbus id: addr3 - name: "Neopixelbus Light" + name: Neopixelbus Light gamma_correct: 2.8 color_correct: [0.0, 0.0, 0.0, 0.0] default_transition_length: 10s @@ -1781,7 +1785,7 @@ light: num_leds: 60 pin: GPIO23 - platform: partition - name: "Partition Light" + name: Partition Light segments: - id: addr1 from: 0 @@ -1795,13 +1799,13 @@ light: - single_light_id: ${roomname}_lights - platform: shelly_dimmer - name: "Shelly Dimmer Light" + name: Shelly Dimmer Light power: - name: "Shelly Dimmer Power" + name: Shelly Dimmer Power voltage: - name: "Shelly Dimmer Voltage" + name: Shelly Dimmer Voltage current: - name: "Shelly Dimmer Current" + name: Shelly Dimmer Current max_brightness: 500 firmware: "51.6" uart_id: uart0 @@ -1813,8 +1817,8 @@ remote_transmitter: climate: - platform: tcl112 name: TCL112 Climate With Sensor - supports_heat: True - supports_cool: True + supports_heat: true + supports_cool: true sensor: ${sensorname}_sensor - platform: tcl112 name: TCL112 Climate @@ -1836,8 +1840,8 @@ climate: target_temperature_state_topic: target/temperature/state/topic - platform: coolix name: Coolix Climate With Sensor - supports_heat: True - supports_cool: True + supports_heat: true + supports_cool: true sensor: ${sensorname}_sensor - platform: coolix name: Coolix Climate @@ -1871,7 +1875,7 @@ climate: use_fahrenheit: true - platform: midea on_state: - logger.log: "State changed!" + logger.log: State changed! id: midea_unit uart_id: uart0 name: Midea Climate @@ -1905,11 +1909,11 @@ climate: - HORIZONTAL - BOTH outdoor_temperature: - name: "Temp" + name: Temp power_usage: - name: "Power" + name: Power humidity_setpoint: - name: "Humidity" + name: Humidity - platform: anova name: Anova cooker ble_client_id: ble_blah @@ -1955,7 +1959,7 @@ switch: # Use pin number 0 number: 0 mode: OUTPUT - inverted: False + inverted: false - platform: gpio name: "MCP23S17 Pin #0" pin: @@ -1963,12 +1967,12 @@ switch: # Use pin number 0 number: 1 mode: OUTPUT - inverted: False + inverted: false - platform: gpio pin: GPIO25 - name: "Living Room Dehumidifier" + name: Living Room Dehumidifier icon: "mdi:restart" - inverted: True + inverted: true command_topic: custom_command_topic command_retain: true restore_mode: ALWAYS_OFF @@ -2045,20 +2049,20 @@ switch: remote_transmitter.transmit_rc_switch_type_a: group: "11001" device: "01000" - state: True + state: true protocol: pulse_length: 175 sync: [1, 31] zero: [1, 3] one: [3, 1] - inverted: False + inverted: false - platform: template name: RC Switch Type B turn_on_action: remote_transmitter.transmit_rc_switch_type_b: address: 4 channel: 2 - state: True + state: true - platform: template name: RC Switch Type C turn_on_action: @@ -2066,14 +2070,14 @@ switch: family: "a" group: 1 device: 2 - state: True + state: true - platform: template name: RC Switch Type D turn_on_action: remote_transmitter.transmit_rc_switch_type_d: group: "a" device: 2 - state: True + state: true - platform: template name: RC5 turn_on_action: @@ -2091,12 +2095,49 @@ switch: turn_on_action: remote_transmitter.transmit_aeha: address: 0x8008 - data: [0x00, 0x02, 0xFD, 0xFF, 0x00, 0x33, 0xCC, 0x49, 0xB6, 0xC8, 0x37, 0x16, 0xE9, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xCA, 0x35, 0x8F, 0x70, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF] + data: + [ + 0x00, + 0x02, + 0xFD, + 0xFF, + 0x00, + 0x33, + 0xCC, + 0x49, + 0xB6, + 0xC8, + 0x37, + 0x16, + 0xE9, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0xCA, + 0x35, + 0x8F, + 0x70, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + 0x00, + 0xFF, + ] - platform: template name: Living Room Lights id: livingroom_lights - optimistic: True - assumed_state: yes + optimistic: true + assumed_state: true turn_on_action: - switch.turn_on: living_room_lights_on - output.set_level: @@ -2119,22 +2160,22 @@ switch: level: !lambda "return 0.5;" turn_off_action: - switch.turn_on: living_room_lights_off - restore_state: False + restore_state: false on_turn_on: - switch.template.publish: id: livingroom_lights - state: yes + state: true - platform: restart - name: "Living Room Restart" + name: Living Room Restart - platform: safe_mode - name: "Living Room Restart (Safe Mode)" + name: Living Room Restart (Safe Mode) - platform: shutdown - name: "Living Room Shutdown" + name: Living Room Shutdown - platform: output - name: "Generic Output" + name: Generic Output output: pca_6 - platform: template - name: "Template Switch" + name: Template Switch id: my_switch lambda: |- if (id(binary_sensor1).state) { @@ -2152,27 +2193,27 @@ switch: // Switch is OFF, do something else here } optimistic: true - assumed_state: no - restore_state: True + assumed_state: false + restore_state: true on_turn_off: - switch.template.publish: id: my_switch state: !lambda "return false;" - platform: uart uart_id: uart0 - name: "UART String Output" - data: "DataToSend" + name: UART String Output + data: DataToSend - platform: uart uart_id: uart0 - name: "UART Bytes Output" + name: UART Bytes Output data: [0xDE, 0xAD, 0xBE, 0xEF] - platform: uart uart_id: uart0 - name: "UART Recurring Output" + name: UART Recurring Output data: [0xDE, 0xAD, 0xBE, 0xEF] send_every: 1s - platform: template - assumed_state: yes + assumed_state: true name: Stepper Switch turn_on_action: - stepper.set_target: @@ -2194,7 +2235,7 @@ switch: sn74hc595: sn74hc595_hub # Use pin number 0 number: 0 - inverted: False + inverted: false - platform: template id: ble1_status optimistic: true @@ -2206,7 +2247,7 @@ switch: fan: - platform: binary output: gpio_26 - name: "Living Room Fan 1" + name: Living Room Fan 1 oscillation_output: gpio_19 direction_output: gpio_26 - platform: speed @@ -2214,7 +2255,7 @@ fan: icon: mdi:weather-windy output: pca_6 speed_count: 10 - name: "Living Room Fan 2" + name: Living Room Fan 2 oscillation_output: gpio_19 direction_output: gpio_26 oscillation_state_topic: oscillation/state/topic @@ -2225,13 +2266,13 @@ fan: speed_command_topic: speed/command/topic on_speed_set: then: - - logger.log: "Fan speed was changed!" + - logger.log: Fan speed was changed! - platform: bedjet name: My Bedjet fan bedjet_id: my_bedjet_client - platform: copy source_id: fan_speed - name: "Fan Speed Copy" + name: Fan Speed Copy interval: - interval: 10s @@ -2242,6 +2283,7 @@ interval: - display.page.show_previous: display1 - interval: 2s then: + # yamllint disable rule:line-length - lambda: |- static uint16_t btn_left_state = id(btn_left)->get_value(); @@ -2250,13 +2292,14 @@ interval: btn_left_state = ((uint32_t) id(btn_left)->get_value() + 63 * (uint32_t)btn_left_state) >> 6; id(btn_left)->set_threshold(btn_left_state * 0.9); + # yamllint enable rule:line-length - if: condition: display.is_displaying_page: id: display1 page_id: page1 then: - - logger.log: "Seeing page 1" + - logger.log: Seeing page 1 color: - id: kbx_red @@ -2328,7 +2371,7 @@ display: lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ssd1306_i2c - model: "SSD1306_128X64" + model: SSD1306_128X64 reset_pin: GPIO23 address: 0x3C id: display1 @@ -2349,28 +2392,28 @@ display: ESP_LOGD("display", "1 -> 2"); i2c_id: i2c_bus - platform: ssd1306_spi - model: "SSD1306 128x64" + model: SSD1306 128x64 cs_pin: GPIO23 dc_pin: GPIO23 reset_pin: GPIO23 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ssd1322_spi - model: "SSD1322 256x64" + model: SSD1322 256x64 cs_pin: GPIO23 dc_pin: GPIO23 reset_pin: GPIO23 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ssd1325_spi - model: "SSD1325 128x64" + model: SSD1325 128x64 cs_pin: GPIO23 dc_pin: GPIO23 reset_pin: GPIO23 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ssd1327_i2c - model: "SSD1327 128X128" + model: SSD1327 128X128 reset_pin: GPIO23 address: 0x3D id: display1327 @@ -2384,7 +2427,7 @@ display: // Nothing i2c_id: i2c_bus - platform: ssd1327_spi - model: "SSD1327 128x128" + model: SSD1327 128x128 cs_pin: GPIO23 dc_pin: GPIO23 reset_pin: GPIO23 @@ -2397,7 +2440,7 @@ display: lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ssd1351_spi - model: "SSD1351 128x128" + model: SSD1351 128x128 cs_pin: GPIO23 dc_pin: GPIO23 reset_pin: GPIO23 @@ -2420,7 +2463,7 @@ display: lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: st7735 - model: "INITR_BLACKTAB" + model: INITR_BLACKTAB cs_pin: GPIO5 dc_pin: GPIO16 reset_pin: GPIO23 @@ -2432,7 +2475,7 @@ display: lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ili9341 - model: "TFT 2.4" + model: TFT 2.4 cs_pin: GPIO5 dc_pin: GPIO4 reset_pin: GPIO22 @@ -2442,7 +2485,7 @@ display: lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: ili9341 - model: "TFT 2.4" + model: TFT 2.4 cs_pin: GPIO5 dc_pin: GPIO4 reset_pin: GPIO22 @@ -2529,7 +2572,7 @@ rc522_i2c: mcp4728: - id: mcp4728_dac - store_in_eeprom: False + store_in_eeprom: false address: 0x60 i2c_id: i2c_bus @@ -2562,7 +2605,7 @@ time: cover: - platform: template - name: "Template Cover" + name: Template Cover id: template_cover lambda: |- if (id(binary_sensor1).state) { @@ -2575,8 +2618,8 @@ cover: - cover.template.publish: id: template_cover state: CLOSED - assumed_state: no - has_position: yes + assumed_state: false + has_position: true position_state_topic: position/state/topic position_command_topic: position/command/topic tilt_lambda: !lambda "return 0.5;" @@ -2589,12 +2632,12 @@ cover: then: - lambda: 'ESP_LOGD("cover", "closed");' - platform: am43 - name: "Test AM43" + name: Test AM43 id: am43_test ble_client_id: ble_foo icon: mdi:blinds - platform: feedback - name: "Feedback Cover" + name: Feedback Cover id: gate device_class: gate @@ -2638,24 +2681,24 @@ tca9548a: i2c_id: multiplex0_chan0 pcf8574: - - id: "pcf8574_hub" + - id: pcf8574_hub address: 0x21 - pcf8575: False + pcf8575: false i2c_id: i2c_bus mcp23017: - - id: "mcp23017_hub" - open_drain_interrupt: "true" + - id: mcp23017_hub + open_drain_interrupt: true i2c_id: i2c_bus mcp23008: - - id: "mcp23008_hub" + - id: mcp23008_hub address: 0x22 - open_drain_interrupt: "true" + open_drain_interrupt: true i2c_id: i2c_bus mcp23016: - - id: "mcp23016_hub" + - id: mcp23016_hub address: 0x23 i2c_id: i2c_bus @@ -2672,29 +2715,29 @@ stepper: globals: - id: glob_int type: int - restore_value: yes + restore_value: true initial_value: "0" - id: glob_float type: float - restore_value: yes + restore_value: true initial_value: "0.0f" - id: glob_bool type: bool - restore_value: no + restore_value: false initial_value: "true" - id: glob_string type: std::string - restore_value: no + restore_value: false # initial_value: "" - id: glob_bool_processed type: bool - restore_value: no + restore_value: false initial_value: "false" text_sensor: - platform: ble_client ble_client_id: ble_foo - name: "Sensor Location" + name: Sensor Location service_uuid: "180d" characteristic_uuid: "2a38" descriptor_uuid: "2902" @@ -2705,7 +2748,7 @@ text_sensor: - lambda: |- ESP_LOGD("green_btn", "Location changed: %s", x.c_str()); - platform: mqtt_subscribe - name: "MQTT Subscribe Text" + name: MQTT Subscribe Text topic: "the/topic" qos: 2 on_value: @@ -2742,25 +2785,25 @@ text_sensor: id: ${textname}_text - platform: wifi_info scan_results: - name: "Scan Results" + name: Scan Results ip_address: - name: "IP Address" + name: IP Address ssid: - name: "SSID" + name: SSID bssid: - name: "BSSID" + name: BSSID mac_address: - name: "Mac Address" + name: Mac Address - platform: version - name: "ESPHome Version No Timestamp" - hide_timestamp: True + name: ESPHome Version No Timestamp + hide_timestamp: true - platform: teleinfo - tag_name: "OPTARIF" - name: "optarif" + tag_name: OPTARIF + name: optarif teleinfo_id: myteleinfo sn74hc595: - - id: "sn74hc595_hub" + - id: sn74hc595_hub data_pin: GPIO21 clock_pin: GPIO23 latch_pin: GPIO22 @@ -2883,7 +2926,7 @@ qr_code: lock: - platform: template id: test_lock1 - name: "Template Switch" + name: Template Switch lambda: |- if (id(binary_sensor1).state) { return LOCK_STATE_LOCKED; @@ -2891,7 +2934,7 @@ lock: return LOCK_STATE_UNLOCKED; } optimistic: true - assumed_state: no + assumed_state: false on_unlock: - lock.template.publish: id: test_lock1 @@ -2901,7 +2944,7 @@ lock: id: test_lock1 state: !lambda "return LOCK_STATE_LOCKED;" - platform: output - name: "Generic Output Lock" + name: Generic Output Lock id: test_lock2 output: pca_6 - platform: copy @@ -2910,7 +2953,7 @@ lock: button: - platform: template - name: "Start calibration" + name: Start calibration on_press: - scd4x.perform_forced_calibration: value: 419 diff --git a/tests/test2.yaml b/tests/test2.yaml index 3dd8f824dd..d01a0a742a 100644 --- a/tests/test2.yaml +++ b/tests/test2.yaml @@ -1,3 +1,4 @@ +--- esphome: name: $devicename platform: ESP32 @@ -28,7 +29,7 @@ api: i2c: sda: 21 scl: 22 - scan: False + scan: false spi: clk_pin: GPIO21 @@ -47,7 +48,7 @@ uart: - lambda: UARTDebug::log_hex(direction, bytes, ':'); ota: - safe_mode: True + safe_mode: true port: 3286 num_attempts: 15 @@ -67,7 +68,7 @@ as3935_i2c: irq_pin: GPIO12 mcp3008: - - id: 'mcp3008_hub' + - id: mcp3008_hub cs_pin: GPIO12 output: @@ -86,35 +87,35 @@ sensor: id: ha_hello_world_temperature - platform: ble_rssi mac_address: AC:37:43:77:5F:4C - name: 'BLE Google Home Mini RSSI value' + name: BLE Google Home Mini RSSI value - platform: ble_rssi - service_uuid: '11aa' - name: 'BLE Test Service 16' + service_uuid: 11aa + name: BLE Test Service 16 - platform: ble_rssi - service_uuid: '11223344' - name: 'BLE Test Service 32' + service_uuid: "11223344" + name: BLE Test Service 32 - platform: ble_rssi - service_uuid: '11223344-5566-7788-99aa-bbccddeeff00' - name: 'BLE Test Service 128' + service_uuid: 11223344-5566-7788-99aa-bbccddeeff00 + name: BLE Test Service 128 - platform: ble_rssi - service_uuid: '11223344-5566-7788-99aa-bbccddeeff00' - name: 'BLE Test iBeacon UUID' + service_uuid: 11223344-5566-7788-99aa-bbccddeeff00 + name: BLE Test iBeacon UUID - platform: b_parasite mac_address: F0:CA:F0:CA:01:01 humidity: - name: 'b-parasite Air Humidity' + name: b-parasite Air Humidity temperature: - name: 'b-parasite Air Temperature' + name: b-parasite Air Temperature moisture: - name: 'b-parasite Soil Moisture' + name: b-parasite Soil Moisture battery_voltage: - name: 'b-parasite Battery Voltage' + name: b-parasite Battery Voltage illuminance: - name: 'b-parasite Illuminance' + name: b-parasite Illuminance - platform: senseair id: senseair0 co2: - name: 'SenseAir CO2 Value' + name: SenseAir CO2 Value on_value: then: - senseair.background_calibration: senseair0 @@ -126,167 +127,167 @@ sensor: - platform: ruuvitag mac_address: FF:56:D3:2F:7D:E8 humidity: - name: 'RuuviTag Humidity' + name: RuuviTag Humidity temperature: - name: 'RuuviTag Temperature' + name: RuuviTag Temperature pressure: - name: 'RuuviTag Pressure' + name: RuuviTag Pressure acceleration_x: - name: 'RuuviTag Acceleration X' + name: RuuviTag Acceleration X acceleration_y: - name: 'RuuviTag Acceleration Y' + name: RuuviTag Acceleration Y acceleration_z: - name: 'RuuviTag Acceleration Z' + name: RuuviTag Acceleration Z battery_voltage: - name: 'RuuviTag Battery Voltage' + name: RuuviTag Battery Voltage tx_power: - name: 'RuuviTag TX Power' + name: RuuviTag TX Power movement_counter: - name: 'RuuviTag Movement Counter' + name: RuuviTag Movement Counter measurement_sequence_number: - name: 'RuuviTag Measurement Sequence Number' + name: RuuviTag Measurement Sequence Number - platform: as3935 lightning_energy: - name: 'Lightning Energy' + name: Lightning Energy distance: - name: 'Distance Storm' + name: Distance Storm - platform: xiaomi_hhccjcy01 mac_address: 94:2B:FF:5C:91:61 temperature: - name: 'Xiaomi HHCCJCY01 Temperature' + name: Xiaomi HHCCJCY01 Temperature moisture: - name: 'Xiaomi HHCCJCY01 Moisture' + name: Xiaomi HHCCJCY01 Moisture illuminance: - name: 'Xiaomi HHCCJCY01 Illuminance' + name: Xiaomi HHCCJCY01 Illuminance conductivity: - name: 'Xiaomi HHCCJCY01 Soil Conductivity' + name: Xiaomi HHCCJCY01 Soil Conductivity battery_level: - name: 'Xiaomi HHCCJCY01 Battery Level' + name: Xiaomi HHCCJCY01 Battery Level - platform: xiaomi_lywsdcgq mac_address: 7A:80:8E:19:36:BA temperature: - name: 'Xiaomi LYWSDCGQ Temperature' + name: Xiaomi LYWSDCGQ Temperature humidity: - name: 'Xiaomi LYWSDCGQ Humidity' + name: Xiaomi LYWSDCGQ Humidity battery_level: - name: 'Xiaomi LYWSDCGQ Battery Level' + name: Xiaomi LYWSDCGQ Battery Level - platform: xiaomi_lywsd02 mac_address: 3F:5B:7D:82:58:4E temperature: - name: 'Xiaomi LYWSD02 Temperature' + name: Xiaomi LYWSD02 Temperature humidity: - name: 'Xiaomi LYWSD02 Humidity' + name: Xiaomi LYWSD02 Humidity battery_level: - name: 'Xiaomi LYWSD02 Battery Level' + name: Xiaomi LYWSD02 Battery Level - platform: xiaomi_cgg1 mac_address: 7A:80:8E:19:36:BA temperature: - name: 'Xiaomi CGG1 Temperature' + name: Xiaomi CGG1 Temperature humidity: - name: 'Xiaomi CGG1 Humidity' + name: Xiaomi CGG1 Humidity battery_level: - name: 'Xiaomi CGG1 Battery Level' + name: Xiaomi CGG1 Battery Level - platform: xiaomi_gcls002 - mac_address: '94:2B:FF:5C:91:61' + mac_address: 94:2B:FF:5C:91:61 temperature: - name: 'GCLS02 Temperature' + name: GCLS02 Temperature moisture: - name: 'GCLS02 Moisture' + name: GCLS02 Moisture conductivity: - name: 'GCLS02 Soil Conductivity' + name: GCLS02 Soil Conductivity illuminance: - name: 'GCLS02 Illuminance' + name: GCLS02 Illuminance - platform: xiaomi_hhccpot002 - mac_address: '94:2B:FF:5C:91:61' + mac_address: 94:2B:FF:5C:91:61 moisture: - name: 'HHCCPOT002 Moisture' + name: HHCCPOT002 Moisture conductivity: - name: 'HHCCPOT002 Soil Conductivity' + name: HHCCPOT002 Soil Conductivity - platform: xiaomi_lywsd03mmc - mac_address: 'A4:C1:38:4E:16:78' - bindkey: 'e9efaa6873f9f9c87a5e75a5f814801c' + mac_address: A4:C1:38:4E:16:78 + bindkey: e9efaa6873f9f9c87a5e75a5f814801c temperature: - name: 'Xiaomi LYWSD03MMC Temperature' + name: Xiaomi LYWSD03MMC Temperature humidity: - name: 'Xiaomi LYWSD03MMC Humidity' + name: Xiaomi LYWSD03MMC Humidity battery_level: - name: 'Xiaomi LYWSD03MMC Battery Level' + name: Xiaomi LYWSD03MMC Battery Level - platform: xiaomi_cgd1 - mac_address: 'A4:C1:38:D1:61:7D' - bindkey: 'c99d2313182473b38001086febf781bd' + mac_address: A4:C1:38:D1:61:7D + bindkey: c99d2313182473b38001086febf781bd temperature: - name: 'Xiaomi CGD1 Temperature' + name: Xiaomi CGD1 Temperature humidity: - name: 'Xiaomi CGD1 Humidity' + name: Xiaomi CGD1 Humidity battery_level: - name: 'Xiaomi CGD1 Battery Level' + name: Xiaomi CGD1 Battery Level - platform: xiaomi_jqjcy01ym - mac_address: '7A:80:8E:19:36:BA' + mac_address: 7A:80:8E:19:36:BA temperature: - name: 'JQJCY01YM Temperature' + name: JQJCY01YM Temperature humidity: - name: 'JQJCY01YM Humidity' + name: JQJCY01YM Humidity formaldehyde: - name: 'JQJCY01YM Formaldehyde' + name: JQJCY01YM Formaldehyde battery_level: - name: 'JQJCY01YM Battery Level' + name: JQJCY01YM Battery Level - platform: xiaomi_mhoc303 - mac_address: 'E7:50:59:32:A0:1C' + mac_address: E7:50:59:32:A0:1C temperature: - name: 'MHO-C303 Temperature' + name: MHO-C303 Temperature humidity: - name: 'MHO-C303 Humidity' + name: MHO-C303 Humidity battery_level: - name: 'MHO-C303 Battery Level' + name: MHO-C303 Battery Level - platform: atc_mithermometer - mac_address: 'A4:C1:38:4E:16:78' + mac_address: A4:C1:38:4E:16:78 temperature: - name: 'ATC Temperature' + name: ATC Temperature humidity: - name: 'ATC Humidity' + name: ATC Humidity battery_level: - name: 'ATC Battery-Level' + name: ATC Battery-Level battery_voltage: - name: 'ATC Battery-Voltage' + name: ATC Battery-Voltage - platform: pvvx_mithermometer - mac_address: 'A4:C1:38:4E:16:78' + mac_address: A4:C1:38:4E:16:78 temperature: - name: 'PVVX Temperature' + name: PVVX Temperature humidity: - name: 'PVVX Humidity' + name: PVVX Humidity battery_level: - name: 'PVVX Battery-Level' + name: PVVX Battery-Level battery_voltage: - name: 'PVVX Battery-Voltage' + name: PVVX Battery-Voltage - platform: inkbird_ibsth1_mini mac_address: 38:81:D7:0A:9C:11 temperature: - name: 'Inkbird IBS-TH1 Temperature' + name: Inkbird IBS-TH1 Temperature humidity: - name: 'Inkbird IBS-TH1 Humidity' + name: Inkbird IBS-TH1 Humidity battery_level: - name: 'Inkbird IBS-TH1 Battery Level' + name: Inkbird IBS-TH1 Battery Level - platform: xiaomi_rtcgq02lm id: motion_rtcgq02lm battery_level: - name: 'Mi Motion Sensor 2 Battery level' + name: Mi Motion Sensor 2 Battery level - platform: ltr390 uv: - name: "LTR390 UV" + name: LTR390 UV uv_index: - name: "LTR390 UVI" + name: LTR390 UVI light: - name: "LTR390 Light" + name: LTR390 Light ambient_light: - name: "LTR390 ALS" - gain: "X3" + name: LTR390 ALS + gain: X3 resolution: 18 window_correction_factor: 1.0 address: 0x53 update_interval: 60s - platform: sgp4x voc: - name: "VOC Index" + name: VOC Index id: sgp40_voc_index algorithm_tuning: index_offset: 100 @@ -296,7 +297,7 @@ sensor: std_initial: 50 gain_factor: 230 nox: - name: "NOx" + name: NOx algorithm_tuning: index_offset: 100 learning_time_offset_hours: 12 @@ -307,7 +308,7 @@ sensor: update_interval: 5s - platform: mcp3008 update_interval: 5s - mcp3008_id: 'mcp3008_hub' + mcp3008_id: mcp3008_hub id: freezer_temp_source reference_voltage: 3.19 number: 0 @@ -315,59 +316,59 @@ sensor: ble_client_id: airthings01 update_interval: 5min temperature: - name: "Wave Plus Temperature" + name: Wave Plus Temperature radon: - name: "Wave Plus Radon" + name: Wave Plus Radon radon_long_term: - name: "Wave Plus Radon Long Term" + name: Wave Plus Radon Long Term pressure: - name: "Wave Plus Pressure" + name: Wave Plus Pressure humidity: - name: "Wave Plus Humidity" + name: Wave Plus Humidity co2: - name: "Wave Plus CO2" + name: Wave Plus CO2 tvoc: - name: "Wave Plus VOC" + name: Wave Plus VOC - platform: airthings_wave_mini ble_client_id: airthingsmini01 update_interval: 5min temperature: - name: "Wave Mini Temperature" + name: Wave Mini Temperature humidity: - name: "Wave Mini Humidity" + name: Wave Mini Humidity pressure: - name: "Wave Mini Pressure" + name: Wave Mini Pressure tvoc: - name: "Wave Mini VOC" + name: Wave Mini VOC - platform: ina260 address: 0x40 current: - name: "INA260 Current" + name: INA260 Current power: - name: "INA260 Power" + name: INA260 Power bus_voltage: - name: "INA260 Voltage" + name: INA260 Voltage update_interval: 60s - platform: radon_eye_rd200 ble_client_id: radon_eye_ble_id update_interval: 10min radon: - name: "RD200 Radon" + name: RD200 Radon radon_long_term: - name: "RD200 Radon Long Term" + name: RD200 Radon Long Term - platform: mopeka_pro_check mac_address: D3:75:F2:DC:16:91 tank_type: CUSTOM custom_distance_full: 40cm custom_distance_empty: 10mm temperature: - name: "Propane test temp" + name: Propane test temp level: - name: "Propane test level" + name: Propane test level distance: - name: "Propane test distance" + name: Propane test distance battery_level: - name: "Propane test battery level" + name: Propane test battery level time: - platform: homeassistant @@ -377,7 +378,7 @@ time: - logger.log: It's 16:00 esp32_touch: - setup_mode: True + setup_mode: true binary_sensor: - platform: homeassistant @@ -389,76 +390,80 @@ binary_sensor: id: ha_hello_world_binary_attribute - platform: ble_presence mac_address: AC:37:43:77:5F:4C - name: 'ESP32 BLE Tracker Google Home Mini' + name: ESP32 BLE Tracker Google Home Mini - platform: ble_presence - service_uuid: '11aa' - name: 'BLE Test Service 16 Presence' + service_uuid: 11aa + name: BLE Test Service 16 Presence - platform: ble_presence - service_uuid: '11223344' - name: 'BLE Test Service 32 Presence' + service_uuid: "11223344" + name: BLE Test Service 32 Presence - platform: ble_presence - service_uuid: '11223344-5566-7788-99aa-bbccddeeff00' - name: 'BLE Test Service 128 Presence' + service_uuid: 11223344-5566-7788-99aa-bbccddeeff00 + name: BLE Test Service 128 Presence - platform: ble_presence - ibeacon_uuid: '11223344-5566-7788-99aa-bbccddeeff00' + ibeacon_uuid: 11223344-5566-7788-99aa-bbccddeeff00 ibeacon_major: 100 ibeacon_minor: 1 - name: 'BLE Test iBeacon Presence' + name: BLE Test iBeacon Presence - platform: esp32_touch - name: 'ESP32 Touch Pad GPIO27' + name: ESP32 Touch Pad GPIO27 pin: GPIO27 threshold: 1000 - platform: as3935 - name: 'Storm Alert' + name: Storm Alert - platform: xiaomi_mue4094rt - name: 'MUE4094RT Motion' - mac_address: '7A:80:8E:19:36:BA' - timeout: '5s' + name: MUE4094RT Motion + mac_address: 7A:80:8E:19:36:BA + timeout: 5s - platform: xiaomi_mjyd02yla - name: 'MJYD02YL-A Motion' - mac_address: '50:EC:50:CD:32:02' - bindkey: '48403ebe2d385db8d0c187f81e62cb64' + name: MJYD02YL-A Motion + mac_address: 50:EC:50:CD:32:02 + bindkey: 48403ebe2d385db8d0c187f81e62cb64 idle_time: - name: 'MJYD02YL-A Idle Time' + name: MJYD02YL-A Idle Time light: - name: 'MJYD02YL-A Light Status' + name: MJYD02YL-A Light Status battery_level: - name: 'MJYD02YL-A Battery Level' + name: MJYD02YL-A Battery Level - platform: xiaomi_wx08zm - name: 'WX08ZM Activation State' - mac_address: '74:a3:4a:b5:07:34' + name: WX08ZM Activation State + mac_address: 74:a3:4a:b5:07:34 tablet: - name: 'WX08ZM Tablet Resource' + name: WX08ZM Tablet Resource battery_level: - name: 'WX08ZM Battery Level' + name: WX08ZM Battery Level - platform: xiaomi_cgpr1 - name: 'CGPR1 Motion' - mac_address: '12:34:56:12:34:56' - bindkey: '48403ebe2d385db8d0c187f81e62cb64' + name: CGPR1 Motion + mac_address: "12:34:56:12:34:56" + bindkey: 48403ebe2d385db8d0c187f81e62cb64 battery_level: - name: 'CGPR1 battery Level' + name: CGPR1 battery Level idle_time: - name: 'CGPR1 Idle Time' + name: CGPR1 Idle Time illuminance: - name: 'CGPR1 Illuminance' + name: CGPR1 Illuminance - platform: xiaomi_rtcgq02lm id: motion_rtcgq02lm motion: - name: 'Mi Motion Sensor 2' + name: Mi Motion Sensor 2 light: - name: 'Mi Motion Sensor 2 Light' + name: Mi Motion Sensor 2 Light button: - name: 'Mi Motion Sensor 2 Button' + name: Mi Motion Sensor 2 Button esp32_ble_tracker: on_ble_advertise: - mac_address: AC:37:43:77:5F:4C then: + # yamllint disable rule:line-length - lambda: !lambda |- ESP_LOGD("main", "The device address is %s", x.address_str().c_str()); + # yamllint enable rule:line-length - then: + # yamllint disable rule:line-length - lambda: !lambda |- ESP_LOGD("main", "The device address is %s", x.address_str().c_str()); + # yamllint enable rule:line-length on_ble_service_data_advertise: - service_uuid: ABCD then: @@ -494,16 +499,12 @@ xiaomi_rtcgq02lm: mac_address: 01:02:03:04:05:06 bindkey: '48403ebe2d385db8d0c187f81e62cb64' -#esp32_ble_beacon: -# type: iBeacon -# uuid: 'c29ce823-e67a-4e71-bff2-abaa32e77a98' - status_led: pin: GPIO2 text_sensor: - platform: version - name: 'ESPHome Version' + name: ESPHome Version icon: mdi:icon id: version_sensor on_value: @@ -511,8 +512,10 @@ text_sensor: condition: - api.connected: then: + # yamllint disable rule:line-length - lambda: !lambda |- ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str()); + # yamllint enable rule:line-length - script.execute: my_script - homeassistant.service: service: notify.html5 @@ -537,19 +540,19 @@ text_sensor: - deep_sleep.enter: sleep_duration: !lambda "return 30 * 60 * 1000;" - platform: template - name: 'Template Text Sensor' + name: Template Text Sensor lambda: |- return {"Hello World"}; filters: - to_upper: - to_lower: - - append: "xyz" - - prepend: "abcd" + - append: xyz + - prepend: abcd - substitute: - Hello -> Goodbye - map: - red -> green - - lambda: return {"1234"}; + - lambda: 'return {"1234"};' - platform: homeassistant entity_id: sensor.hello_world2 id: ha_hello_world2 @@ -587,7 +590,7 @@ stepper: pin_b: GPIO27 pin_c: GPIO25 pin_d: GPIO26 - sleep_when_done: no + sleep_when_done: false step_mode: HALF_STEP max_speed: 250 steps/s @@ -598,7 +601,7 @@ stepper: interval: interval: 5s then: - - logger.log: 'Interval Run' + - logger.log: Interval Run display: @@ -611,7 +614,7 @@ cap1188: switch: - platform: template - name: "Test BLE Write Action" + name: Test BLE Write Action turn_on_action: - ble_client.ble_write: id: airthings01 diff --git a/tests/test3.yaml b/tests/test3.yaml index 4b2224dc3c..de0fc0dfdb 100644 --- a/tests/test3.yaml +++ b/tests/test3.yaml @@ -1,3 +1,4 @@ +--- esphome: name: $device_name comment: $device_comment @@ -9,38 +10,38 @@ esphome: - wifi.connected - time.has_time then: - - logger.log: "Have time" + - logger.log: Have time includes: - custom.h esp8266: board: d1_mini - early_pin_init: True + early_pin_init: true substitutions: device_name: test3 device_comment: test3 device - min_sub: '0.03' - max_sub: '12.0%' + min_sub: "0.03" + max_sub: "12.0%" api: port: 8000 - password: 'pwd' + password: pwd reboot_timeout: 0min encryption: - key: 'bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=' + key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU= services: - service: hello_world variables: name: string then: - logger.log: - format: 'Hello World %s!' + format: Hello World %s! args: - name.c_str() - service: empty_service then: - - logger.log: 'Service Called' + - logger.log: Service Called - service: all_types variables: bool_: bool @@ -48,7 +49,7 @@ api: float_: float string_: string then: - - logger.log: 'Something happened' + - logger.log: Something happened - stepper.set_target: id: my_stepper2 target: !lambda 'return int_;' @@ -60,7 +61,9 @@ api: string_arr: string[] then: - logger.log: + # yamllint disable rule:line-length format: 'Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)' + # yamllint enable rule:line-length args: - YESNO(bool_arr[0]) - bool_arr.size() @@ -104,7 +107,7 @@ api: then: - dfplayer.play_folder: folder: !lambda 'return folder;' - loop: True + loop: true - service: dfplayer_set_device variables: @@ -122,7 +125,9 @@ api: variables: preset: int then: + # yamllint disable rule:line-length - dfplayer.set_eq: !lambda 'return static_cast(preset);' + # yamllint enable rule:line-length - service: dfplayer_sleep then: @@ -220,7 +225,7 @@ wifi: i2c: sda: 4 scl: 5 - scan: False + scan: false spi: clk_pin: GPIO12 @@ -231,7 +236,7 @@ uart: - id: uart1 tx_pin: number: GPIO1 - inverted: yes + inverted: true rx_pin: GPIO3 baud_rate: 115200 - id: uart2 @@ -279,7 +284,7 @@ modbus: uart_id: uart1 ota: - safe_mode: True + safe_mode: true port: 3286 reboot_timeout: 15min @@ -302,40 +307,40 @@ adalight: sensor: - platform: daly_bms voltage: - name: "Battery Voltage" + name: Battery Voltage current: - name: "Battery Current" + name: Battery Current battery_level: - name: "Battery Level" + name: Battery Level max_cell_voltage: - name: "Max Cell Voltage" + name: Max Cell Voltage max_cell_voltage_number: - name: "Max Cell Voltage Number" + name: Max Cell Voltage Number min_cell_voltage: - name: "Min Cell Voltage" + name: Min Cell Voltage min_cell_voltage_number: - name: "Min Cell Voltage Number" + name: Min Cell Voltage Number max_temperature: - name: "Max Temperature" + name: Max Temperature max_temperature_probe_number: - name: "Max Temperature Probe Number" + name: Max Temperature Probe Number min_temperature: - name: "Min Temperature" + name: Min Temperature min_temperature_probe_number: - name: "Min Temperature Probe Number" + name: Min Temperature Probe Number remaining_capacity: - name: "Remaining Capacity" + name: Remaining Capacity cells_number: - name: "Cells Number" + name: Cells Number temperature_1: - name: "Temperature 1" + name: Temperature 1 temperature_2: - name: "Temperature 2" + name: Temperature 2 - platform: apds9960 type: proximity name: APDS9960 Proximity - platform: vl53l0x - name: 'VL53L0x Distance' + name: VL53L0x Distance address: 0x29 update_interval: 60s enable_pin: GPIO13 @@ -357,32 +362,32 @@ sensor: id: ha_hello_world - platform: aht10 temperature: - name: 'Temperature' + name: Temperature humidity: - name: 'Humidity' + name: Humidity - platform: am2320 temperature: - name: 'Temperature' + name: Temperature humidity: - name: 'Humidity' + name: Humidity - platform: hydreon_rgxx - model: "RG 9" + model: RG 9 uart_id: uart6 - id: "hydreon_rg9" + id: hydreon_rg9 moisture: - name: "hydreon_rain" + name: hydreon_rain id: hydreon_rain - platform: hydreon_rgxx - model: "RG_15" + model: RG_15 uart_id: uart6 acc: - name: "hydreon_acc" + name: hydreon_acc event_acc: - name: "hydreon_event_acc" + name: hydreon_event_acc total_acc: - name: "hydreon_total_acc" + name: hydreon_total_acc r_int: - name: "hydreon_r_int" + name: hydreon_r_int - platform: adc pin: VCC id: my_sensor @@ -496,281 +501,281 @@ sensor: - platform: bl0939 uart_id: uart8 voltage: - name: 'BL0939 Voltage' + name: BL0939 Voltage current_1: - name: 'BL0939 Current 1' + name: BL0939 Current 1 current_2: - name: 'BL0939 Current 2' + name: BL0939 Current 2 active_power_1: - name: 'BL0939 Active Power 1' + name: BL0939 Active Power 1 active_power_2: - name: 'BL0939 Active Power 2' + name: BL0939 Active Power 2 energy_1: - name: 'BL0939 Energy 1' + name: BL0939 Energy 1 energy_2: - name: 'BL0939 Energy 2' + name: BL0939 Energy 2 energy_total: - name: 'BL0939 Total energy' + name: BL0939 Total energy - platform: bl0940 uart_id: uart3 voltage: - name: 'BL0940 Voltage' + name: BL0940 Voltage current: - name: 'BL0940 Current' + name: BL0940 Current power: - name: 'BL0940 Power' + name: BL0940 Power energy: - name: 'BL0940 Energy' + name: BL0940 Energy internal_temperature: - name: 'BL0940 Internal temperature' + name: BL0940 Internal temperature external_temperature: - name: 'BL0940 External temperature' + name: BL0940 External temperature - platform: pzem004t uart_id: uart3 voltage: - name: 'PZEM004T Voltage' + name: PZEM004T Voltage current: - name: 'PZEM004T Current' + name: PZEM004T Current power: - name: 'PZEM004T Power' + name: PZEM004T Power - platform: pzemac id: pzemac1 voltage: - name: 'PZEMAC Voltage' + name: PZEMAC Voltage current: - name: 'PZEMAC Current' + name: PZEMAC Current power: - name: 'PZEMAC Power' + name: PZEMAC Power energy: - name: 'PZEMAC Energy' + name: PZEMAC Energy frequency: - name: 'PZEMAC Frequency' + name: PZEMAC Frequency power_factor: - name: 'PZEMAC Power Factor' + name: PZEMAC Power Factor - platform: pzemdc voltage: - name: 'PZEMDC Voltage' + name: PZEMDC Voltage current: - name: 'PZEMDC Current' + name: PZEMDC Current power: - name: 'PZEMDC Power' + name: PZEMDC Power - platform: tmp102 - name: 'TMP102 Temperature' + name: TMP102 Temperature - platform: hm3301 pm_1_0: - name: 'PM1.0' + name: PM1.0 pm_2_5: - name: 'PM2.5' + name: PM2.5 pm_10_0: - name: 'PM10.0' + name: PM10.0 aqi: - name: 'AQI' - calculation_type: 'AQI' + name: AQI + calculation_type: AQI - platform: pmsx003 uart_id: uart9 type: PMSX003 pm_1_0: - name: 'PM 1.0 Concentration' + name: PM 1.0 Concentration pm_2_5: - name: 'PM 2.5 Concentration' + name: PM 2.5 Concentration pm_10_0: - name: 'PM 10.0 Concentration' + name: PM 10.0 Concentration pm_1_0_std: - name: 'PM 1.0 Standard Atmospher Concentration' + name: PM 1.0 Standard Atmospher Concentration pm_2_5_std: - name: 'PM 2.5 Standard Atmospher Concentration' + name: PM 2.5 Standard Atmospher Concentration pm_10_0_std: - name: 'PM 10.0 Standard Atmospher Concentration' + name: PM 10.0 Standard Atmospher Concentration pm_0_3um: - name: 'Particulate Count >0.3um' + name: Particulate Count >0.3um pm_0_5um: - name: 'Particulate Count >0.5um' + name: Particulate Count >0.5um pm_1_0um: - name: 'Particulate Count >1.0um' + name: Particulate Count >1.0um pm_2_5um: - name: 'Particulate Count >2.5um' + name: Particulate Count >2.5um pm_5_0um: - name: 'Particulate Count >5.0um' + name: Particulate Count >5.0um pm_10_0um: - name: 'Particulate Count >10.0um' + name: Particulate Count >10.0um update_interval: 30s - platform: pmsx003 uart_id: uart5 type: PMS5003T pm_2_5: - name: 'PM 2.5 Concentration' + name: PM 2.5 Concentration temperature: - name: 'PMS Temperature' + name: PMS Temperature humidity: - name: 'PMS Humidity' + name: PMS Humidity - platform: pmsx003 uart_id: uart6 type: PMS5003ST pm_1_0: - name: 'PM 1.0 Concentration' + name: PM 1.0 Concentration pm_2_5: - name: 'PM 2.5 Concentration' + name: PM 2.5 Concentration pm_10_0: - name: 'PM 10.0 Concentration' + name: PM 10.0 Concentration pm_1_0_std: - name: 'PM 1.0 Standard Atmospher Concentration' + name: PM 1.0 Standard Atmospher Concentration pm_2_5_std: - name: 'PM 2.5 Standard Atmospher Concentration' + name: PM 2.5 Standard Atmospher Concentration pm_10_0_std: - name: 'PM 10.0 Standard Atmospher Concentration' + name: PM 10.0 Standard Atmospher Concentration pm_0_3um: - name: 'Particulate Count >0.3um' + name: Particulate Count >0.3um pm_0_5um: - name: 'Particulate Count >0.5um' + name: Particulate Count >0.5um pm_1_0um: - name: 'Particulate Count >1.0um' + name: Particulate Count >1.0um pm_2_5um: - name: 'Particulate Count >2.5um' + name: Particulate Count >2.5um pm_5_0um: - name: 'Particulate Count >5.0um' + name: Particulate Count >5.0um pm_10_0um: - name: 'Particulate Count >10.0um' + name: Particulate Count >10.0um temperature: - name: 'PMS Temperature' + name: PMS Temperature humidity: - name: 'PMS Humidity' + name: PMS Humidity formaldehyde: - name: 'PMS Formaldehyde Concentration' + name: PMS Formaldehyde Concentration - platform: cse7761 uart_id: uart7 voltage: - name: 'CSE7761 Voltage' + name: CSE7761 Voltage current_1: - name: 'CSE7761 Current 1' + name: CSE7761 Current 1 current_2: - name: 'CSE7761 Current 2' + name: CSE7761 Current 2 active_power_1: - name: 'CSE7761 Active Power 1' + name: CSE7761 Active Power 1 active_power_2: - name: 'CSE7761 Active Power 2' + name: CSE7761 Active Power 2 - platform: cse7766 uart_id: uart3 voltage: - name: 'CSE7766 Voltage' + name: CSE7766 Voltage current: - name: 'CSE7766 Current' + name: CSE7766 Current power: - name: 'CSE776 Power' + name: CSE776 Power - platform: ezo id: ph_ezo address: 99 - unit_of_measurement: 'pH' + unit_of_measurement: pH - platform: tof10120 - name: "Distance sensor" + name: Distance sensor update_interval: 5s - platform: fingerprint_grow fingerprint_count: - name: "Fingerprint Count" + name: Fingerprint Count status: - name: "Fingerprint Status" + name: Fingerprint Status capacity: - name: "Fingerprint Capacity" + name: Fingerprint Capacity security_level: - name: "Fingerprint Security Level" + name: Fingerprint Security Level last_finger_id: - name: "Fingerprint Last Finger ID" + name: Fingerprint Last Finger ID last_confidence: - name: "Fingerprint Last Confidence" + name: Fingerprint Last Confidence - platform: sdm_meter phase_a: current: - name: 'Phase A Current' + name: Phase A Current voltage: - name: 'Phase A Voltage' + name: Phase A Voltage active_power: - name: 'Phase A Power' + name: Phase A Power power_factor: - name: 'Phase A Power Factor' + name: Phase A Power Factor apparent_power: - name: 'Phase A Apparent Power' + name: Phase A Apparent Power reactive_power: - name: 'Phase A Reactive Power' + name: Phase A Reactive Power phase_angle: - name: 'Phase A Phase Angle' + name: Phase A Phase Angle phase_b: current: - name: 'Phase B Current' + name: Phase B Current voltage: - name: 'Phase B Voltage' + name: Phase B Voltage active_power: - name: 'Phase B Power' + name: Phase B Power power_factor: - name: 'Phase B Power Factor' + name: Phase B Power Factor apparent_power: - name: 'Phase B Apparent Power' + name: Phase B Apparent Power reactive_power: - name: 'Phase B Reactive Power' + name: Phase B Reactive Power phase_angle: - name: 'Phase B Phase Angle' + name: Phase B Phase Angle phase_c: current: - name: 'Phase C Current' + name: Phase C Current voltage: - name: 'Phase C Voltage' + name: Phase C Voltage active_power: - name: 'Phase C Power' + name: Phase C Power power_factor: - name: 'Phase C Power Factor' + name: Phase C Power Factor apparent_power: - name: 'Phase C Apparent Power' + name: Phase C Apparent Power reactive_power: - name: 'Phase C Reactive Power' + name: Phase C Reactive Power phase_angle: - name: 'Phase C Phase Angle' + name: Phase C Phase Angle frequency: - name: 'Frequency' + name: Frequency import_active_energy: - name: 'Import Active Energy' + name: Import Active Energy export_active_energy: - name: 'Export Active Energy' + name: Export Active Energy import_reactive_energy: - name: 'Import Reactive Energy' + name: Import Reactive Energy export_reactive_energy: - name: 'Export Reactive Energy' + name: Export Reactive Energy - platform: dsmr energy_delivered_tariff1: name: dsmr_energy_delivered_tariff1 - platform: nextion id: testnumber - name: 'testnumber' + name: testnumber variable_name: testnumber - platform: nextion id: testwave - name: 'testwave' + name: testwave component_id: 2 wave_channel_id: 1 - platform: mlx90393 oversampling: 1 filter: 0 - gain: "3X" + gain: 3X x_axis: - name: "mlxxaxis" + name: mlxxaxis y_axis: - name: "mlxyaxis" + name: mlxyaxis z_axis: - name: "mlxzaxis" + name: mlxzaxis resolution: 17BIT temperature: - name: "mlxtemp" + name: mlxtemp oversampling: 2 - platform: smt100 uart_id: uart10 counts: - name: "Counts" + name: Counts dielectric_constant: - name: "Dielectric Constant" + name: Dielectric Constant temperature: - name: "Temperature" + name: Temperature moisture: - name: "Moisture" + name: Moisture voltage: - name: "Voltage" + name: Voltage update_interval: 60s time: - platform: homeassistant @@ -786,9 +791,9 @@ mpr121: binary_sensor: - platform: daly_bms charging_mos_enabled: - name: "Charging MOS" + name: Charging MOS discharging_mos_enabled: - name: "Discharging MOS" + name: Discharging MOS - platform: apds9960 direction: up name: APDS9960 Up @@ -816,18 +821,18 @@ binary_sensor: - platform: mpr121 id: touchkey0 channel: 0 - name: 'touchkey0' + name: touchkey0 - platform: mpr121 channel: 1 - name: 'touchkey1' + name: touchkey1 id: bin1 - platform: mpr121 channel: 2 - name: 'touchkey2' + name: touchkey2 id: bin2 - platform: mpr121 channel: 3 - name: 'touchkey3' + name: touchkey3 id: bin3 on_press: then: @@ -839,7 +844,7 @@ binary_sensor: channel: 1 name: TTP229 BSF Test - platform: fingerprint_grow - name: "Fingerprint Enrolling" + name: Fingerprint Enrolling - platform: custom lambda: |- auto s = new CustomBinarySensor(); @@ -851,27 +856,27 @@ binary_sensor: - platform: nextion page_id: 0 component_id: 2 - name: 'Nextion Component 2 Touch' + name: Nextion Component 2 Touch - platform: nextion id: r0_sensor - name: 'R0 Sensor' + name: R0 Sensor component_name: page0.r0 - platform: template - id: 'cover_toggle' + id: cover_toggle on_press: then: - cover.toggle: time_based_cover - cover.toggle: endstop_cover - platform: hydreon_rgxx - hydreon_rgxx_id: "hydreon_rg9" + hydreon_rgxx_id: hydreon_rg9 too_cold: - name: "rg9_toocold" + name: rg9_toocold em_sat: - name: "rg9_emsat" + name: rg9_emsat lens_bad: - name: "rg9_lens_bad" + name: rg9_lens_bad - platform: template - id: 'pzemac_reset_energy' + id: pzemac_reset_energy on_press: then: - pzemac.reset_energy: pzemac1 @@ -891,14 +896,16 @@ status_led: text_sensor: - platform: daly_bms status: - name: "BMS Status" + name: BMS Status - platform: version - name: 'ESPHome Version' + name: ESPHome Version icon: mdi:icon id: version_sensor on_value: + # yamllint disable rule:line-length - lambda: !lambda |- ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str()); + # yamllint enable rule:line-length - script.execute: my_script - script.wait: my_script - script.stop: my_script @@ -912,7 +919,7 @@ text_sensor: my_variable: |- return id(version_sensor).state; - platform: template - name: 'Template Text Sensor' + name: Template Text Sensor lambda: |- return {"Hello World"}; - platform: homeassistant @@ -933,9 +940,9 @@ text_sensor: component_name: text0 - platform: dsmr identification: - name: "dsmr_identification" + name: dsmr_identification p1_version: - name: "dsmr_p1_version" + name: dsmr_p1_version script: - id: my_script @@ -948,9 +955,9 @@ sm2135: switch: - platform: template - name: 'mpr121_toggle' + name: mpr121_toggle id: mpr121_toggle - optimistic: True + optimistic: true - platform: gpio id: gpio_switch1 pin: @@ -978,7 +985,7 @@ switch: name: Custom Switch - platform: nextion id: r0 - name: 'R0 Switch' + name: R0 Switch component_name: page0.r0 custom_component: @@ -994,7 +1001,7 @@ stepper: pin_b: GPIO13 pin_c: GPIO14 pin_d: GPIO15 - sleep_when_done: no + sleep_when_done: false step_mode: HALF_STEP max_speed: 250 steps/s acceleration: inf @@ -1010,7 +1017,7 @@ stepper: interval: interval: 5s then: - - logger.log: 'Interval Run' + - logger.log: Interval Run - stepper.set_target: id: my_stepper2 target: 500 @@ -1123,7 +1130,7 @@ climate: default_target_temperature_high: 20°C - platform: pid id: pid_climate - name: 'PID Climate Controller' + name: PID Climate Controller sensor: ha_hello_world default_target_temperature: 21°C heat_output: my_slow_pwm @@ -1134,42 +1141,42 @@ climate: sprinkler: - id: yard_sprinkler_ctrlr - main_switch: "Yard Sprinklers" - auto_advance_switch: "Yard Sprinklers Auto Advance" - reverse_switch: "Yard Sprinklers Reverse" + main_switch: Yard Sprinklers + auto_advance_switch: Yard Sprinklers Auto Advance + reverse_switch: Yard Sprinklers Reverse pump_start_pump_delay: 2s pump_stop_valve_delay: 4s pump_switch_off_during_valve_open_delay: true valve_open_delay: 5s valves: - - valve_switch: "Yard Valve 0" - enable_switch: "Enable Yard Valve 0" + - valve_switch: Yard Valve 0 + enable_switch: Enable Yard Valve 0 pump_switch_id: gpio_switch1 run_duration: 10s valve_switch_id: gpio_switch2 - - valve_switch: "Yard Valve 1" - enable_switch: "Enable Yard Valve 1" + - valve_switch: Yard Valve 1 + enable_switch: Enable Yard Valve 1 pump_switch_id: gpio_switch1 run_duration: 10s valve_switch_id: gpio_switch2 - - valve_switch: "Yard Valve 2" - enable_switch: "Enable Yard Valve 2" + - valve_switch: Yard Valve 2 + enable_switch: Enable Yard Valve 2 pump_switch_id: gpio_switch1 run_duration: 10s valve_switch_id: gpio_switch2 - id: garden_sprinkler_ctrlr - main_switch: "Garden Sprinklers" - auto_advance_switch: "Garden Sprinklers Auto Advance" - reverse_switch: "Garden Sprinklers Reverse" + main_switch: Garden Sprinklers + auto_advance_switch: Garden Sprinklers Auto Advance + reverse_switch: Garden Sprinklers Reverse valve_overlap: 5s valves: - - valve_switch: "Garden Valve 0" - enable_switch: "Enable Garden Valve 0" + - valve_switch: Garden Valve 0 + enable_switch: Enable Garden Valve 0 pump_switch_id: gpio_switch1 run_duration: 10s valve_switch_id: gpio_switch2 - - valve_switch: "Garden Valve 1" - enable_switch: "Enable Garden Valve 1" + - valve_switch: Garden Valve 1 + enable_switch: Enable Garden Valve 1 pump_switch_id: gpio_switch1 run_duration: 10s valve_switch_id: gpio_switch2 @@ -1219,7 +1226,7 @@ cover: - switch.turn_on: gpio_switch2 close_duration: 4.5min - platform: current_based - name: "Current Based Cover" + name: Current Based Cover open_sensor: ade7953_current_a open_moving_current_threshold: 0.5 open_obstacle_current_threshold: 0.8 @@ -1240,7 +1247,7 @@ cover: malfunction_detection: true malfunction_action: then: - - logger.log: "Malfunction Detected" + - logger.log: Malfunction Detected - platform: template name: Template Cover with Tilt tilt_lambda: 'return 0.5;' @@ -1326,7 +1333,7 @@ light: pin_b: out2 - platform: sonoff_d1 uart_id: uart2 - use_rm433_remote: False + use_rm433_remote: false name: Sonoff D1 Dimmer id: d1_light restore_mode: RESTORE_DEFAULT_OFF @@ -1352,7 +1359,7 @@ sim800l: str = sender; str = message; - sim800l.send_sms: - message: 'hello you' + message: hello you recipient: '+1234' - sim800l.dial: recipient: '+1234' @@ -1365,7 +1372,7 @@ dfplayer: condition: not: dfplayer.is_playing then: - logger.log: 'Playback finished event' + logger.log: Playback finished event tm1651: id: tm1651_battery clk_pin: D6 @@ -1394,8 +1401,8 @@ rf_bridge: test = data.length; test = data.protocol; test_code = data.code; - - rf_bridge.start_advanced_sniffing - - rf_bridge.stop_advanced_sniffing + - rf_bridge.start_advanced_sniffing: + - rf_bridge.stop_advanced_sniffing: - rf_bridge.send_advanced_code: length: 0x04 protocol: 0x01 @@ -1413,13 +1420,13 @@ rf_bridge: json: key: !lambda |- return id(version_sensor).state; - greeting: 'Hello World' + greeting: Hello World - http_request.send: method: PUT url: https://esphome.io headers: Content-Type: application/json - body: 'Some data' + body: Some data verify_ssl: false display: @@ -1428,13 +1435,13 @@ display: num_chips: 4 rotate_chip: 0 intensity: 10 - scroll_mode: 'STOP' + scroll_mode: STOP id: my_matrix lambda: |- it.printdigit("hello"); - platform: nextion uart_id: uart1 - tft_url: 'http://esphome.io/default35.tft' + tft_url: http://esphome.io/default35.tft update_interval: 5s on_sleep: then: diff --git a/tests/test4.yaml b/tests/test4.yaml index c3079037c1..d6857de7cd 100644 --- a/tests/test4.yaml +++ b/tests/test4.yaml @@ -1,3 +1,4 @@ +--- esphome: name: $devicename platform: ESP32 @@ -25,7 +26,7 @@ api: i2c: sda: 21 scl: 22 - scan: False + scan: false spi: clk_pin: GPIO21 @@ -38,7 +39,7 @@ uart: baud_rate: 115200 ota: - safe_mode: True + safe_mode: true port: 3286 logger: @@ -71,7 +72,7 @@ select: 2: Both pipsolar: - id: inverter0 + id: inverter0 sx1509: - id: sx1509_hub @@ -81,9 +82,9 @@ mcp3204: cs_pin: GPIO23 dac7678: - address: 0x4A - id: dac7678_hub1 - internal_reference: true + address: 0x4A + id: dac7678_hub1 + internal_reference: true sensor: - platform: homeassistant @@ -226,22 +227,22 @@ sensor: pv_charging_power: id: inverter0_pv_charging_power name: inverter0_pv_charging_power - - platform: "hrxl_maxsonar_wr" - name: "Rainwater Tank Level" + - platform: hrxl_maxsonar_wr + name: Rainwater Tank Level filters: - sliding_window_moving_average: window_size: 12 send_every: 12 - or: - - throttle: "20min" - - delta: 0.02 + - throttle: 20min + - delta: 0.02 - platform: mcp3204 - name: "MCP3204 Pin 1" + name: MCP3204 Pin 1 number: 1 id: mcp_sensor - platform: copy source_id: mcp_sensor - name: "MCP binary sensor copy" + name: MCP binary sensor copy # # platform sensor.apds9960 requires component apds9960 @@ -321,15 +322,15 @@ binary_sensor: name: inverter0_backlight_on - platform: template id: ar1 - lambda: 'return {};' + lambda: "return {};" filters: - autorepeat: - - delay: 2s - time_off: 100ms - time_on: 900ms - - delay: 4s - time_off: 100ms - time_on: 400ms + - delay: 2s + time_off: 100ms + time_on: 900ms + - delay: 4s + time_off: 100ms + time_on: 400ms on_state: then: - lambda: 'ESP_LOGI("ar1:", "%d", x);' @@ -356,8 +357,7 @@ binary_sensor: y_min: 0 y_max: 100 on_press: - - logger.log: "Touched" - + - logger.log: Touched climate: - platform: tuya @@ -392,7 +392,7 @@ switch: light: - platform: fastled_clockless id: led_matrix_32x8 - name: "led_matrix_32x8" + name: led_matrix_32x8 chipset: WS2812B pin: GPIO15 num_leds: 256 @@ -417,7 +417,7 @@ cover: position_datapoint: 2 - platform: copy source_id: tuya_cover - name: "Tuya Cover copy" + name: Tuya Cover copy display: - platform: addressable_light @@ -516,7 +516,7 @@ text_sensor: name: inverter0_last_qflag - platform: copy source_id: inverter0_device_mode - name: "Inverter Text Sensor Copy" + name: Inverter Text Sensor Copy output: - platform: pipsolar @@ -524,37 +524,37 @@ output: battery_recharge_voltage: id: inverter0_battery_recharge_voltage_out - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 0 - id: 'dac7678_1_ch0' + id: dac7678_1_ch0 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 1 - id: 'dac7678_1_ch1' + id: dac7678_1_ch1 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 2 - id: 'dac7678_1_ch2' + id: dac7678_1_ch2 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 3 - id: 'dac7678_1_ch3' + id: dac7678_1_ch3 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 4 - id: 'dac7678_1_ch4' + id: dac7678_1_ch4 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 5 - id: 'dac7678_1_ch5' + id: dac7678_1_ch5 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 6 - id: 'dac7678_1_ch6' + id: dac7678_1_ch6 - platform: dac7678 - dac7678_id: 'dac7678_hub1' + dac7678_id: dac7678_hub1 channel: 7 - id: 'dac7678_1_ch7' + id: dac7678_1_ch7 esp32_camera: name: ESP-32 Camera data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19] @@ -581,9 +581,9 @@ esp32_camera_web_server: external_components: - source: github://esphome/esphome@dev refresh: 1d - components: ["bh1750"] + components: [bh1750] - source: ../esphome/components - components: ["sntp"] + components: [sntp] xpt2046: id: xpt_touchscreen cs_pin: 17 @@ -597,8 +597,9 @@ xpt2046: calibration_x_max: 280 calibration_y_min: 340 calibration_y_max: 3860 - swap_x_y: False + swap_x_y: false on_state: + # yamllint disable rule:line-length - lambda: |- ESP_LOGI("main", "args x=%d, y=%d, touched=%s", x, y, (touched ? "touch" : "release")); ESP_LOGI("main", "member x=%d, y=%d, touched=%d, x_raw=%d, y_raw=%d, z_raw=%d", @@ -609,6 +610,7 @@ xpt2046: id(xpt_touchscreen).y_raw, id(xpt_touchscreen).z_raw ); + # yamllint enable rule:line-length button: - platform: restart @@ -622,7 +624,6 @@ button: source_id: shutdown_btn name: Shutdown Button Copy - touchscreen: - platform: ektf2232 interrupt_pin: GPIO36 @@ -631,7 +632,7 @@ touchscreen: on_touch: - logger.log: format: Touch at (%d, %d) - args: ["touch.x", "touch.y"] + args: [touch.x, touch.y] - platform: lilygo_t5_47 id: lilygo_touchscreen @@ -640,7 +641,7 @@ touchscreen: on_touch: - logger.log: format: Touch at (%d, %d) - args: ["touch.x", "touch.y"] + args: [touch.x, touch.y] media_player: - platform: i2s_audio @@ -673,4 +674,4 @@ prometheus: relabel: ha_hello_world: id: hellow_world - name: "Hello World" + name: Hello World diff --git a/tests/test5.yaml b/tests/test5.yaml index c193009ead..3b6862a4d4 100644 --- a/tests/test5.yaml +++ b/tests/test5.yaml @@ -1,3 +1,4 @@ +--- esphome: name: test5 build_path: build/test5 @@ -60,8 +61,10 @@ mqtt: topic: testing/sensor/testing_sensor/state qos: 0 then: + # yamllint disable rule:line-length - lambda: |- - ESP_LOGD("Mqtt Test","testing/sensor/testing_sensor/state=[%s]",x.c_str()); + ESP_LOGD("Mqtt Test", "testing/sensor/testing_sensor/state=[%s]", x.c_str()); + # yamllint enable rule:line-length binary_sensor: - platform: gpio @@ -74,8 +77,8 @@ binary_sensor: id: modbus_binsensortest register_type: read address: 0x3200 - bitmask: 0x80 #(bit 8) - lambda: !lambda "{ return x ;}" + bitmask: 0x80 # (bit 8) + lambda: "return x;" tlc5947: data_pin: GPIO12 @@ -108,8 +111,8 @@ demo: esp32_ble: esp32_ble_server: - manufacturer: "ESPHome" - model: "Test5" + manufacturer: ESPHome + model: Test5 esp32_improv: authorizer: io0_button @@ -128,12 +131,12 @@ number: mode: slider on_value: - logger.log: - format: "Number changed to %f" - args: ["x"] + format: Number changed to %f + args: [x] set_action: - logger.log: - format: "Template Number set to %f" - args: ["x"] + format: Template Number set to %f + args: [x] - number.set: id: template_number_id value: 50 @@ -163,10 +166,10 @@ number: - id: modbus_numbertest platform: modbus_controller modbus_controller_id: modbus_controller_test - name: "ModbusNumber" + name: ModbusNumber address: 0x9002 value_type: U_WORD - lambda: "return x * 1.0; " + lambda: "return x * 1.0;" write_lambda: |- return x * 1.0 ; multiply: 1.0 @@ -180,11 +183,11 @@ select: restore_value: true on_value: - logger.log: - format: "Select changed to %s (index %d)" + format: Select changed to %s (index %d)" args: ["x.c_str()", "i"] set_action: - logger.log: - format: "Template Select set to %s" + format: Template Select set to %s args: ["x.c_str()"] - select.set: id: template_select_id @@ -216,7 +219,7 @@ select: - three - platform: modbus_controller - name: "Modbus Select Register 1000" + name: Modbus Select Register 1000 address: 1000 value_type: U_WORD optionsmap: @@ -228,41 +231,41 @@ select: sensor: - platform: selec_meter total_active_energy: - name: "SelecEM2M Total Active Energy" + name: SelecEM2M Total Active Energy import_active_energy: - name: "SelecEM2M Import Active Energy" + name: SelecEM2M Import Active Energy export_active_energy: - name: "SelecEM2M Export Active Energy" + name: SelecEM2M Export Active Energy total_reactive_energy: - name: "SelecEM2M Total Reactive Energy" + name: SelecEM2M Total Reactive Energy import_reactive_energy: - name: "SelecEM2M Import Reactive Energy" + name: SelecEM2M Import Reactive Energy export_reactive_energy: - name: "SelecEM2M Export Reactive Energy" + name: SelecEM2M Export Reactive Energy apparent_energy: - name: "SelecEM2M Apparent Energy" + name: SelecEM2M Apparent Energy active_power: - name: "SelecEM2M Active Power" + name: SelecEM2M Active Power reactive_power: - name: "SelecEM2M Reactive Power" + name: SelecEM2M Reactive Power apparent_power: - name: "SelecEM2M Apparent Power" + name: SelecEM2M Apparent Power voltage: - name: "SelecEM2M Voltage" + name: SelecEM2M Voltage current: - name: "SelecEM2M Current" + name: SelecEM2M Current power_factor: - name: "SelecEM2M Power Factor" + name: SelecEM2M Power Factor frequency: - name: "SelecEM2M Frequency" + name: SelecEM2M Frequency maximum_demand_active_power: - name: "SelecEM2M Maximum Demand Active Power" + name: SelecEM2M Maximum Demand Active Power disabled_by_default: true maximum_demand_reactive_power: - name: "SelecEM2M Maximum Demand Reactive Power" + name: SelecEM2M Maximum Demand Reactive Power disabled_by_default: true maximum_demand_apparent_power: - name: "SelecEM2M Maximum Demand Apparent Power" + name: SelecEM2M Maximum Demand Apparent Power disabled_by_default: true - id: modbus_sensortest @@ -279,41 +282,41 @@ sensor: - platform: bmp3xx temperature: - name: "BMP Temperature" + name: BMP Temperature oversampling: 16x pressure: - name: "BMP Pressure" + name: BMP Pressure address: 0x77 iir_filter: 2X - platform: sen5x id: sen54 temperature: - name: "Temperature" + name: Temperature accuracy_decimals: 1 humidity: - name: "Humidity" + name: Humidity accuracy_decimals: 0 pm_1_0: - name: " PM <1µm Weight concentration" + name: PM <1µm Weight concentration id: pm_1_0 accuracy_decimals: 1 pm_2_5: - name: " PM <2.5µm Weight concentration" + name: PM <2.5µm Weight concentration id: pm_2_5 accuracy_decimals: 1 pm_4_0: - name: " PM <4µm Weight concentration" + name: PM <4µm Weight concentration id: pm_4_0 accuracy_decimals: 1 pm_10_0: - name: " PM <10µm Weight concentration" + name: PM <10µm Weight concentration id: pm_10_0 accuracy_decimals: 1 nox: - name: "NOx" + name: NOx voc: - name: "VOC" + name: VOC algorithm_tuning: index_offset: 100 learning_time_offset_hours: 12 @@ -332,9 +335,9 @@ sensor: - platform: mcp9600 thermocouple_type: K hot_junction: - name: "Thermocouple Temperature" + name: Thermocouple Temperature cold_junction: - name: "Ambient Temperature" + name: Ambient Temperature script: - id: automation_test @@ -342,7 +345,7 @@ script: - repeat: count: 5 then: - - logger.log: "looping!" + - logger.log: looping! switch: - platform: modbus_controller diff --git a/tests/test_packages/test_packages_package1.yaml b/tests/test_packages/test_packages_package1.yaml index 0495984d42..312bbe574a 100644 --- a/tests/test_packages/test_packages_package1.yaml +++ b/tests/test_packages/test_packages_package1.yaml @@ -1,2 +1,3 @@ +--- sensor: - <<: !include ./test_uptime_sensor.yaml diff --git a/tests/test_packages/test_packages_package_wifi.yaml b/tests/test_packages/test_packages_package_wifi.yaml index 7d5d41ddab..a8c610edfd 100644 --- a/tests/test_packages/test_packages_package_wifi.yaml +++ b/tests/test_packages/test_packages_package_wifi.yaml @@ -1,4 +1,5 @@ +--- wifi: networks: - - ssid: 'WiFiFromPackage' - password: 'password1' + - ssid: "WiFiFromPackage" + password: "password1" diff --git a/tests/test_packages/test_uptime_sensor.yaml b/tests/test_packages/test_uptime_sensor.yaml index 1bf52a6d0b..f15d968fee 100644 --- a/tests/test_packages/test_uptime_sensor.yaml +++ b/tests/test_packages/test_uptime_sensor.yaml @@ -1,3 +1,4 @@ +--- # Uptime sensor. platform: uptime id: ${devicename}_uptime_pcg diff --git a/tests/unit_tests/fixtures/yaml_util/includes/scalar.yaml b/tests/unit_tests/fixtures/yaml_util/includes/scalar.yaml index ddd2156b5e..89879248aa 100644 --- a/tests/unit_tests/fixtures/yaml_util/includes/scalar.yaml +++ b/tests/unit_tests/fixtures/yaml_util/includes/scalar.yaml @@ -1 +1,2 @@ +--- ${var1} diff --git a/tests/unit_tests/fixtures/yaml_util/includetest.yaml b/tests/unit_tests/fixtures/yaml_util/includetest.yaml index 959283df60..af0a4e2030 100644 --- a/tests/unit_tests/fixtures/yaml_util/includetest.yaml +++ b/tests/unit_tests/fixtures/yaml_util/includetest.yaml @@ -8,10 +8,11 @@ wifi: !include name: my_custom_ssid esphome: - # should be substituted as 'original', not overwritten by vars in the !include above + # should be substituted as 'original', + # not overwritten by vars in the !include above name: ${name} name_add_mac_suffix: true platform: esp8266 - board: !include { file: includes/scalar.yaml, vars: { var1: nodemcu } } + board: !include {file: includes/scalar.yaml, vars: {var1: nodemcu}} - libraries: !include { file: includes/list.yaml, vars: { var1: Wire } } + libraries: !include {file: includes/list.yaml, vars: {var1: Wire}}