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

View File

@@ -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

1
.github/FUNDING.yml vendored
View File

@@ -1,3 +1,4 @@
---
# These are supported funding model platforms
custom: https://www.nabucasa.com

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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')

View File

@@ -1,8 +1,10 @@
---
name: Lock
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '30 0 * * *'
- cron: "30 0 * * *"
workflow_dispatch:
permissions:

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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:

3
.yamllint Normal file
View File

@@ -0,0 +1,3 @@
---
ignore: |
venv/

View File

@@ -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

View File

@@ -1,3 +1,4 @@
---
esphome:
name: test
platform: ESP8266

View File

@@ -1,3 +1,4 @@
---
esphome:
name: test
platform: ESP32

View File

@@ -1,3 +1,4 @@
---
esphome:
name: test
platform: ESP32

View File

@@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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

View File

@@ -1,2 +1,3 @@
---
sensor:
- <<: !include ./test_uptime_sensor.yaml

View File

@@ -1,4 +1,5 @@
---
wifi:
networks:
- ssid: 'WiFiFromPackage'
password: 'password1'
- ssid: "WiFiFromPackage"
password: "password1"

View File

@@ -1,3 +1,4 @@
---
# Uptime sensor.
platform: uptime
id: ${devicename}_uptime_pcg

View File

@@ -1 +1,2 @@
---
${var1}

View File

@@ -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}}