YAML linting (#3779)

This commit is contained in:
Jesse Hills
2022-09-06 15:48:01 +12:00
committed by GitHub
parent c317422ed7
commit 89fd367297
27 changed files with 1039 additions and 933 deletions
+1 -2
View File
@@ -25,10 +25,9 @@ indent_size = 2
[*.{yaml,yml}] [*.{yaml,yml}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
quote_type = single quote_type = double
# JSON # JSON
[*.json] [*.json]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
+1
View File
@@ -1,3 +1,4 @@
---
# These are supported funding model platforms # These are supported funding model platforms
custom: https://www.nabucasa.com custom: https://www.nabucasa.com
+6 -2
View File
@@ -1,3 +1,4 @@
---
blank_issues_enabled: false blank_issues_enabled: false
contact_links: contact_links:
- name: Issue Tracker - name: Issue Tracker
@@ -5,7 +6,10 @@ contact_links:
about: Please create bug reports in the dedicated issue tracker. about: Please create bug reports in the dedicated issue tracker.
- name: Feature Request Tracker - name: Feature Request Tracker
url: https://github.com/esphome/feature-requests 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 - name: Frequently Asked Question
url: https://esphome.io/guides/faq.html 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.
+4 -3
View File
@@ -1,13 +1,14 @@
---
version: 2 version: 2
updates: updates:
- package-ecosystem: "pip" - package-ecosystem: pip
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: daily
ignore: ignore:
# Hypotehsis is only used for testing and is updated quite often # Hypotehsis is only used for testing and is updated quite often
- dependency-name: hypothesis - dependency-name: hypothesis
- package-ecosystem: "github-actions" - package-ecosystem: github-actions
directory: "/" directory: "/"
schedule: schedule:
interval: daily interval: daily
+11 -9
View File
@@ -1,21 +1,23 @@
---
name: CI for docker images name: CI for docker images
# Only run when docker paths change # Only run when docker paths change
# yamllint disable-line rule:truthy
on: on:
push: push:
branches: [dev, beta, release] branches: [dev, beta, release]
paths: paths:
- 'docker/**' - "docker/**"
- '.github/workflows/**' - ".github/workflows/**"
- 'requirements*.txt' - "requirements*.txt"
- 'platformio.ini' - "platformio.ini"
pull_request: pull_request:
paths: paths:
- 'docker/**' - "docker/**"
- '.github/workflows/**' - ".github/workflows/**"
- 'requirements*.txt' - "requirements*.txt"
- 'platformio.ini' - "platformio.ini"
permissions: permissions:
contents: read contents: read
@@ -34,7 +36,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: "3.9"
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Set up QEMU - name: Set up QEMU
+18 -3
View File
@@ -1,5 +1,7 @@
---
name: CI name: CI
# yamllint disable-line rule:truthy
on: on:
push: push:
branches: [dev, beta, release] branches: [dev, beta, release]
@@ -10,6 +12,7 @@ permissions:
contents: read contents: read
concurrency: concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true cancel-in-progress: true
@@ -73,6 +76,8 @@ jobs:
name: Run script/clang-tidy for ESP32 IDF name: Run script/clang-tidy for ESP32 IDF
options: --environment esp32-idf-tidy --grep USE_ESP_IDF options: --environment esp32-idf-tidy --grep USE_ESP_IDF
pio_cache_key: tidyesp32-idf pio_cache_key: tidyesp32-idf
- id: yamllint
name: Run yamllint
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@@ -80,17 +85,19 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
id: python id: python
with: with:
python-version: '3.8' python-version: "3.8"
- name: Cache virtualenv - name: Cache virtualenv
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: .venv path: .venv
# yamllint disable-line rule:line-length
key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }} key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }}
restore-keys: | restore-keys: |
venv-${{ steps.python.outputs.python-version }}- venv-${{ steps.python.outputs.python-version }}-
- name: Set up virtualenv - name: Set up virtualenv
# yamllint disable rule:line-length
run: | run: |
python -m venv .venv python -m venv .venv
source .venv/bin/activate source .venv/bin/activate
@@ -99,12 +106,14 @@ jobs:
pip install -e . pip install -e .
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
# yamllint enable rule:line-length
# Use per check platformio cache because checks use different parts # Use per check platformio cache because checks use different parts
- name: Cache platformio - name: Cache platformio
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.platformio path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }} key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
if: matrix.id == 'test' || matrix.id == 'clang-tidy' if: matrix.id == 'test' || matrix.id == 'clang-tidy'
@@ -145,8 +154,9 @@ jobs:
pytest -vv --tb=native tests pytest -vv --tb=native tests
if: matrix.id == 'pytest' if: matrix.id == 'pytest'
# Also run git-diff-index so that the step is marked as failed on formatting errors, # Also run git-diff-index so that the step is marked as failed on
# since clang-format doesn't do anything but change files if -i is passed. # formatting errors, since clang-format doesn't do anything but
# change files if -i is passed.
- name: Run clang-format - name: Run clang-format
run: | run: |
script/clang-format -i script/clang-format -i
@@ -161,6 +171,11 @@ jobs:
# Also cache libdeps, store them in a ~/.platformio subfolder # Also cache libdeps, store them in a ~/.platformio subfolder
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
- name: Run yamllint
if: matrix.id == 'yamllint'
uses: frenck/action-yamllint@v1.2.0
- name: Suggested changes - name: Suggested changes
run: script/ci-suggest-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') if: always() && (matrix.id == 'clang-tidy' || matrix.id == 'clang-format' || matrix.id == 'lint-python')
+3 -1
View File
@@ -1,8 +1,10 @@
---
name: Lock name: Lock
# yamllint disable-line rule:truthy
on: on:
schedule: schedule:
- cron: '30 0 * * *' - cron: "30 0 * * *"
workflow_dispatch: workflow_dispatch:
permissions: permissions:
+9 -3
View File
@@ -1,5 +1,7 @@
---
name: Publish Release name: Publish Release
# yamllint disable-line rule:truthy
on: on:
workflow_dispatch: workflow_dispatch:
release: release:
@@ -20,6 +22,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get tag - name: Get tag
id: tag id: tag
# yamllint disable rule:line-length
run: | run: |
if [[ "$GITHUB_EVENT_NAME" = "release" ]]; then if [[ "$GITHUB_EVENT_NAME" = "release" ]]; then
TAG="${GITHUB_REF#refs/tags/}" TAG="${GITHUB_REF#refs/tags/}"
@@ -29,6 +32,7 @@ jobs:
TAG="${TAG}${today}" TAG="${TAG}${today}"
fi fi
echo "::set-output name=tag::${TAG}" echo "::set-output name=tag::${TAG}"
# yamllint enable rule:line-length
deploy-pypi: deploy-pypi:
name: Build and publish to PyPi name: Build and publish to PyPi
@@ -39,7 +43,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.x' python-version: "3.x"
- name: Set up python environment - name: Set up python environment
run: | run: |
script/setup script/setup
@@ -69,7 +73,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: "3.9"
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
@@ -112,7 +116,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: "3.9"
- name: Enable experimental manifest support - name: Enable experimental manifest support
run: | run: |
mkdir -p ~/.docker mkdir -p ~/.docker
@@ -144,6 +148,7 @@ jobs:
steps: steps:
- env: - env:
TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }}
# yamllint disable rule:line-length
run: | run: |
TAG="${GITHUB_REF#refs/tags/}" TAG="${GITHUB_REF#refs/tags/}"
curl \ curl \
@@ -152,3 +157,4 @@ jobs:
-H "Accept: application/vnd.github.v3+json" \ -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \ https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \
-d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$TAG\"}}" -d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$TAG\"}}"
# yamllint enable rule:line-length
+5 -2
View File
@@ -1,8 +1,10 @@
---
name: Stale name: Stale
# yamllint disable-line rule:truthy
on: on:
schedule: schedule:
- cron: '30 0 * * *' - cron: "30 0 * * *"
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@@ -31,7 +33,8 @@ jobs:
and will be closed if no further activity occurs within 7 days. and will be closed if no further activity occurs within 7 days.
Thank you for your contributions. 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: close-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
+2
View File
@@ -1,6 +1,8 @@
---
ports: ports:
- port: 6052 - port: 6052
onOpen: open-preview onOpen: open-preview
tasks: tasks:
# yamllint disable-line rule:line-length
- before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup - before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup
command: python -m esphome dashboard config command: python -m esphome dashboard config
+1
View File
@@ -1,3 +1,4 @@
---
# See https://pre-commit.com for more information # See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
repos: repos:
+3
View File
@@ -0,0 +1,3 @@
---
ignore: |
venv/
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP8266 platform: ESP8266
@@ -6,13 +7,13 @@ esphome:
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
id: bs_1 id: bs_1
name: "test bs1" name: test bs1
internal: true internal: true
pin: pin:
number: D0 number: D0
- platform: gpio - platform: gpio
id: bs_2 id: bs_2
name: "test bs2" name: test bs2
internal: false internal: false
pin: pin:
number: D1 number: D1
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP8266 platform: ESP8266
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP32 platform: ESP32
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP32 platform: ESP32
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP8266 platform: ESP8266
@@ -7,6 +8,6 @@ sensor:
- platform: adc - platform: adc
pin: A0 pin: A0
id: s_1 id: s_1
name: "test s1" name: test s1
update_interval: 60s update_interval: 60s
device_class: "voltage" device_class: voltage
+409 -366
View File
File diff suppressed because it is too large Load Diff
+162 -159
View File
File diff suppressed because it is too large Load Diff
+217 -210
View File
File diff suppressed because it is too large Load Diff
+37 -36
View File
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: $devicename name: $devicename
platform: ESP32 platform: ESP32
@@ -25,7 +26,7 @@ api:
i2c: i2c:
sda: 21 sda: 21
scl: 22 scl: 22
scan: False scan: false
spi: spi:
clk_pin: GPIO21 clk_pin: GPIO21
@@ -38,7 +39,7 @@ uart:
baud_rate: 115200 baud_rate: 115200
ota: ota:
safe_mode: True safe_mode: true
port: 3286 port: 3286
logger: logger:
@@ -226,22 +227,22 @@ sensor:
pv_charging_power: pv_charging_power:
id: inverter0_pv_charging_power id: inverter0_pv_charging_power
name: inverter0_pv_charging_power name: inverter0_pv_charging_power
- platform: "hrxl_maxsonar_wr" - platform: hrxl_maxsonar_wr
name: "Rainwater Tank Level" name: Rainwater Tank Level
filters: filters:
- sliding_window_moving_average: - sliding_window_moving_average:
window_size: 12 window_size: 12
send_every: 12 send_every: 12
- or: - or:
- throttle: "20min" - throttle: 20min
- delta: 0.02 - delta: 0.02
- platform: mcp3204 - platform: mcp3204
name: "MCP3204 Pin 1" name: MCP3204 Pin 1
number: 1 number: 1
id: mcp_sensor id: mcp_sensor
- platform: copy - platform: copy
source_id: mcp_sensor source_id: mcp_sensor
name: "MCP binary sensor copy" name: MCP binary sensor copy
# #
# platform sensor.apds9960 requires component apds9960 # platform sensor.apds9960 requires component apds9960
@@ -321,7 +322,7 @@ binary_sensor:
name: inverter0_backlight_on name: inverter0_backlight_on
- platform: template - platform: template
id: ar1 id: ar1
lambda: 'return {};' lambda: "return {};"
filters: filters:
- autorepeat: - autorepeat:
- delay: 2s - delay: 2s
@@ -356,8 +357,7 @@ binary_sensor:
y_min: 0 y_min: 0
y_max: 100 y_max: 100
on_press: on_press:
- logger.log: "Touched" - logger.log: Touched
climate: climate:
- platform: tuya - platform: tuya
@@ -392,7 +392,7 @@ switch:
light: light:
- platform: fastled_clockless - platform: fastled_clockless
id: led_matrix_32x8 id: led_matrix_32x8
name: "led_matrix_32x8" name: led_matrix_32x8
chipset: WS2812B chipset: WS2812B
pin: GPIO15 pin: GPIO15
num_leds: 256 num_leds: 256
@@ -417,7 +417,7 @@ cover:
position_datapoint: 2 position_datapoint: 2
- platform: copy - platform: copy
source_id: tuya_cover source_id: tuya_cover
name: "Tuya Cover copy" name: Tuya Cover copy
display: display:
- platform: addressable_light - platform: addressable_light
@@ -516,7 +516,7 @@ text_sensor:
name: inverter0_last_qflag name: inverter0_last_qflag
- platform: copy - platform: copy
source_id: inverter0_device_mode source_id: inverter0_device_mode
name: "Inverter Text Sensor Copy" name: Inverter Text Sensor Copy
output: output:
- platform: pipsolar - platform: pipsolar
@@ -524,37 +524,37 @@ output:
battery_recharge_voltage: battery_recharge_voltage:
id: inverter0_battery_recharge_voltage_out id: inverter0_battery_recharge_voltage_out
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 0 channel: 0
id: 'dac7678_1_ch0' id: dac7678_1_ch0
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 1 channel: 1
id: 'dac7678_1_ch1' id: dac7678_1_ch1
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 2 channel: 2
id: 'dac7678_1_ch2' id: dac7678_1_ch2
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 3 channel: 3
id: 'dac7678_1_ch3' id: dac7678_1_ch3
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 4 channel: 4
id: 'dac7678_1_ch4' id: dac7678_1_ch4
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 5 channel: 5
id: 'dac7678_1_ch5' id: dac7678_1_ch5
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 6 channel: 6
id: 'dac7678_1_ch6' id: dac7678_1_ch6
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 7 channel: 7
id: 'dac7678_1_ch7' id: dac7678_1_ch7
esp32_camera: esp32_camera:
name: ESP-32 Camera name: ESP-32 Camera
data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19] data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19]
@@ -581,9 +581,9 @@ esp32_camera_web_server:
external_components: external_components:
- source: github://esphome/esphome@dev - source: github://esphome/esphome@dev
refresh: 1d refresh: 1d
components: ["bh1750"] components: [bh1750]
- source: ../esphome/components - source: ../esphome/components
components: ["sntp"] components: [sntp]
xpt2046: xpt2046:
id: xpt_touchscreen id: xpt_touchscreen
cs_pin: 17 cs_pin: 17
@@ -597,8 +597,9 @@ xpt2046:
calibration_x_max: 280 calibration_x_max: 280
calibration_y_min: 340 calibration_y_min: 340
calibration_y_max: 3860 calibration_y_max: 3860
swap_x_y: False swap_x_y: false
on_state: on_state:
# yamllint disable rule:line-length
- lambda: |- - lambda: |-
ESP_LOGI("main", "args x=%d, y=%d, touched=%s", x, y, (touched ? "touch" : "release")); 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", 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).y_raw,
id(xpt_touchscreen).z_raw id(xpt_touchscreen).z_raw
); );
# yamllint enable rule:line-length
button: button:
- platform: restart - platform: restart
@@ -622,7 +624,6 @@ button:
source_id: shutdown_btn source_id: shutdown_btn
name: Shutdown Button Copy name: Shutdown Button Copy
touchscreen: touchscreen:
- platform: ektf2232 - platform: ektf2232
interrupt_pin: GPIO36 interrupt_pin: GPIO36
@@ -631,7 +632,7 @@ touchscreen:
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)
args: ["touch.x", "touch.y"] args: [touch.x, touch.y]
- platform: lilygo_t5_47 - platform: lilygo_t5_47
id: lilygo_touchscreen id: lilygo_touchscreen
@@ -640,7 +641,7 @@ touchscreen:
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)
args: ["touch.x", "touch.y"] args: [touch.x, touch.y]
media_player: media_player:
- platform: i2s_audio - platform: i2s_audio
@@ -673,4 +674,4 @@ prometheus:
relabel: relabel:
ha_hello_world: ha_hello_world:
id: hellow_world id: hellow_world
name: "Hello World" name: Hello World
+44 -41
View File
@@ -1,3 +1,4 @@
---
esphome: esphome:
name: test5 name: test5
build_path: build/test5 build_path: build/test5
@@ -60,8 +61,10 @@ mqtt:
topic: testing/sensor/testing_sensor/state topic: testing/sensor/testing_sensor/state
qos: 0 qos: 0
then: then:
# yamllint disable rule:line-length
- lambda: |- - 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: binary_sensor:
- platform: gpio - platform: gpio
@@ -75,7 +78,7 @@ binary_sensor:
register_type: read register_type: read
address: 0x3200 address: 0x3200
bitmask: 0x80 # (bit 8) bitmask: 0x80 # (bit 8)
lambda: !lambda "{ return x ;}" lambda: "return x;"
tlc5947: tlc5947:
data_pin: GPIO12 data_pin: GPIO12
@@ -108,8 +111,8 @@ demo:
esp32_ble: esp32_ble:
esp32_ble_server: esp32_ble_server:
manufacturer: "ESPHome" manufacturer: ESPHome
model: "Test5" model: Test5
esp32_improv: esp32_improv:
authorizer: io0_button authorizer: io0_button
@@ -128,12 +131,12 @@ number:
mode: slider mode: slider
on_value: on_value:
- logger.log: - logger.log:
format: "Number changed to %f" format: Number changed to %f
args: ["x"] args: [x]
set_action: set_action:
- logger.log: - logger.log:
format: "Template Number set to %f" format: Template Number set to %f
args: ["x"] args: [x]
- number.set: - number.set:
id: template_number_id id: template_number_id
value: 50 value: 50
@@ -163,7 +166,7 @@ number:
- id: modbus_numbertest - id: modbus_numbertest
platform: modbus_controller platform: modbus_controller
modbus_controller_id: modbus_controller_test modbus_controller_id: modbus_controller_test
name: "ModbusNumber" name: ModbusNumber
address: 0x9002 address: 0x9002
value_type: U_WORD value_type: U_WORD
lambda: "return x * 1.0;" lambda: "return x * 1.0;"
@@ -180,11 +183,11 @@ select:
restore_value: true restore_value: true
on_value: on_value:
- logger.log: - logger.log:
format: "Select changed to %s (index %d)" format: Select changed to %s (index %d)"
args: ["x.c_str()", "i"] args: ["x.c_str()", "i"]
set_action: set_action:
- logger.log: - logger.log:
format: "Template Select set to %s" format: Template Select set to %s
args: ["x.c_str()"] args: ["x.c_str()"]
- select.set: - select.set:
id: template_select_id id: template_select_id
@@ -216,7 +219,7 @@ select:
- three - three
- platform: modbus_controller - platform: modbus_controller
name: "Modbus Select Register 1000" name: Modbus Select Register 1000
address: 1000 address: 1000
value_type: U_WORD value_type: U_WORD
optionsmap: optionsmap:
@@ -228,41 +231,41 @@ select:
sensor: sensor:
- platform: selec_meter - platform: selec_meter
total_active_energy: total_active_energy:
name: "SelecEM2M Total Active Energy" name: SelecEM2M Total Active Energy
import_active_energy: import_active_energy:
name: "SelecEM2M Import Active Energy" name: SelecEM2M Import Active Energy
export_active_energy: export_active_energy:
name: "SelecEM2M Export Active Energy" name: SelecEM2M Export Active Energy
total_reactive_energy: total_reactive_energy:
name: "SelecEM2M Total Reactive Energy" name: SelecEM2M Total Reactive Energy
import_reactive_energy: import_reactive_energy:
name: "SelecEM2M Import Reactive Energy" name: SelecEM2M Import Reactive Energy
export_reactive_energy: export_reactive_energy:
name: "SelecEM2M Export Reactive Energy" name: SelecEM2M Export Reactive Energy
apparent_energy: apparent_energy:
name: "SelecEM2M Apparent Energy" name: SelecEM2M Apparent Energy
active_power: active_power:
name: "SelecEM2M Active Power" name: SelecEM2M Active Power
reactive_power: reactive_power:
name: "SelecEM2M Reactive Power" name: SelecEM2M Reactive Power
apparent_power: apparent_power:
name: "SelecEM2M Apparent Power" name: SelecEM2M Apparent Power
voltage: voltage:
name: "SelecEM2M Voltage" name: SelecEM2M Voltage
current: current:
name: "SelecEM2M Current" name: SelecEM2M Current
power_factor: power_factor:
name: "SelecEM2M Power Factor" name: SelecEM2M Power Factor
frequency: frequency:
name: "SelecEM2M Frequency" name: SelecEM2M Frequency
maximum_demand_active_power: maximum_demand_active_power:
name: "SelecEM2M Maximum Demand Active Power" name: SelecEM2M Maximum Demand Active Power
disabled_by_default: true disabled_by_default: true
maximum_demand_reactive_power: maximum_demand_reactive_power:
name: "SelecEM2M Maximum Demand Reactive Power" name: SelecEM2M Maximum Demand Reactive Power
disabled_by_default: true disabled_by_default: true
maximum_demand_apparent_power: maximum_demand_apparent_power:
name: "SelecEM2M Maximum Demand Apparent Power" name: SelecEM2M Maximum Demand Apparent Power
disabled_by_default: true disabled_by_default: true
- id: modbus_sensortest - id: modbus_sensortest
@@ -279,41 +282,41 @@ sensor:
- platform: bmp3xx - platform: bmp3xx
temperature: temperature:
name: "BMP Temperature" name: BMP Temperature
oversampling: 16x oversampling: 16x
pressure: pressure:
name: "BMP Pressure" name: BMP Pressure
address: 0x77 address: 0x77
iir_filter: 2X iir_filter: 2X
- platform: sen5x - platform: sen5x
id: sen54 id: sen54
temperature: temperature:
name: "Temperature" name: Temperature
accuracy_decimals: 1 accuracy_decimals: 1
humidity: humidity:
name: "Humidity" name: Humidity
accuracy_decimals: 0 accuracy_decimals: 0
pm_1_0: pm_1_0:
name: " PM <1µm Weight concentration" name: PM <1µm Weight concentration
id: pm_1_0 id: pm_1_0
accuracy_decimals: 1 accuracy_decimals: 1
pm_2_5: pm_2_5:
name: " PM <2.5µm Weight concentration" name: PM <2.5µm Weight concentration
id: pm_2_5 id: pm_2_5
accuracy_decimals: 1 accuracy_decimals: 1
pm_4_0: pm_4_0:
name: " PM <4µm Weight concentration" name: PM <4µm Weight concentration
id: pm_4_0 id: pm_4_0
accuracy_decimals: 1 accuracy_decimals: 1
pm_10_0: pm_10_0:
name: " PM <10µm Weight concentration" name: PM <10µm Weight concentration
id: pm_10_0 id: pm_10_0
accuracy_decimals: 1 accuracy_decimals: 1
nox: nox:
name: "NOx" name: NOx
voc: voc:
name: "VOC" name: VOC
algorithm_tuning: algorithm_tuning:
index_offset: 100 index_offset: 100
learning_time_offset_hours: 12 learning_time_offset_hours: 12
@@ -332,9 +335,9 @@ sensor:
- platform: mcp9600 - platform: mcp9600
thermocouple_type: K thermocouple_type: K
hot_junction: hot_junction:
name: "Thermocouple Temperature" name: Thermocouple Temperature
cold_junction: cold_junction:
name: "Ambient Temperature" name: Ambient Temperature
script: script:
- id: automation_test - id: automation_test
@@ -342,7 +345,7 @@ script:
- repeat: - repeat:
count: 5 count: 5
then: then:
- logger.log: "looping!" - logger.log: looping!
switch: switch:
- platform: modbus_controller - platform: modbus_controller
@@ -1,2 +1,3 @@
---
sensor: sensor:
- <<: !include ./test_uptime_sensor.yaml - <<: !include ./test_uptime_sensor.yaml
@@ -1,4 +1,5 @@
---
wifi: wifi:
networks: networks:
- ssid: 'WiFiFromPackage' - ssid: "WiFiFromPackage"
password: 'password1' password: "password1"
@@ -1,3 +1,4 @@
---
# Uptime sensor. # Uptime sensor.
platform: uptime platform: uptime
id: ${devicename}_uptime_pcg id: ${devicename}_uptime_pcg
@@ -1 +1,2 @@
---
${var1} ${var1}
@@ -8,7 +8,8 @@ wifi: !include
name: my_custom_ssid name: my_custom_ssid
esphome: 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: ${name}
name_add_mac_suffix: true name_add_mac_suffix: true
platform: esp8266 platform: esp8266