diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ad8a84..841816f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Get changed YAML files + id: changed + uses: tj-actions/changed-files@v46 + with: + files: "**/*.yaml" + - uses: ibiqlik/action-yamllint@v3 + if: steps.changed.outputs.any_changed == 'true' with: config_file: .yamllint.yml - file_or_dir: "*.yaml common/**/*.yaml" + file_or_dir: ${{ steps.changed.outputs.all_changed_files }} validate: name: ESPHome config validation diff --git a/.yamllint.yml b/.yamllint.yml index 067c610..9aca8ad 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -3,7 +3,7 @@ extends: default rules: # ESPHome uses True/False (Python style) and yes/no truthy: - allowed-values: ["true", "false", "True", "False", "yes", "no"] + allowed-values: ["true", "false", "True", "False", "yes", "no", "on", "off", "ON", "OFF"] check-keys: false # Lambdas and long substitutions can exceed 80 chars @@ -17,6 +17,5 @@ rules: # Some files have trailing spaces; warn only trailing-spaces: enable - # Allow comments without a space after # in some cases (e.g. # noqa) comments: - min-spaces-before-comment: 1 + require-starting-space: false diff --git a/mcu-pow-dishwasher.yaml b/mcu-pow-dishwasher.yaml index e2be21b..6ef30d7 100644 --- a/mcu-pow-dishwasher.yaml +++ b/mcu-pow-dishwasher.yaml @@ -20,10 +20,10 @@ packages: common: !include common/common.yaml uart: -- id: cse7766_uart - rx_pin: 16 - baud_rate: 4800 - parity: EVEN + - id: cse7766_uart + rx_pin: 16 + baud_rate: 4800 + parity: EVEN binary_sensor: - platform: gpio @@ -82,7 +82,7 @@ display: it.display_kwh(false); it.printf(0, "%.1f", id(v_sensor).state); it.printf(1, "%.1f", id(a_sensor).state); - } else { + } else { it.display_voltage(false); it.display_kwh(true); it.printf(0, "%.1f", id(wh_sensor).state); @@ -183,4 +183,4 @@ switch: interlock: [relay_on] time: - - !include common/time/homeassistant.yaml \ No newline at end of file + - !include common/time/homeassistant.yaml diff --git a/mcu-pow-washer.yaml b/mcu-pow-washer.yaml index e36860f..424868c 100644 --- a/mcu-pow-washer.yaml +++ b/mcu-pow-washer.yaml @@ -20,10 +20,10 @@ packages: common: !include common/common.yaml uart: -- id: cse7766_uart - rx_pin: 16 - baud_rate: 4800 - parity: EVEN + - id: cse7766_uart + rx_pin: 16 + baud_rate: 4800 + parity: EVEN binary_sensor: - platform: gpio @@ -82,7 +82,7 @@ display: it.display_kwh(false); it.printf(0, "%.1f", id(v_sensor).state); it.printf(1, "%.1f", id(a_sensor).state); - } else { + } else { it.display_voltage(false); it.display_kwh(true); it.printf(0, "%.1f", id(wh_sensor).state); @@ -183,4 +183,4 @@ switch: interlock: [relay_on] time: - - !include common/time/homeassistant.yaml \ No newline at end of file + - !include common/time/homeassistant.yaml