Skip to content

Commit

Permalink
YAML linting (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Jul 31, 2024
1 parent 2fe0f67 commit 11c4e23
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ concurrency:
cancel-in-progress: true

jobs:
yamllint:
name: 🧹 yamllint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/checkout@v4.1.7
- name: 🚀 Run yamllint
run: yamllint --strict .

build-firmware:
name: Build Firmware
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
extends: default

ignore-from-file: .gitignore

rules:
document-start: disable
empty-lines:
level: error
max: 1
max-start: 0
max-end: 1
indentation:
level: error
spaces: 2
indent-sequences: true
check-multi-line-strings: false
line-length: disable
truthy: disable
47 changes: 23 additions & 24 deletions voice-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ esphome:
name: esphome.voice-kit
version: "1.0"
on_boot:
priority: 600
then:
# Run the script to refresh the LED status
- script.execute: control_leds
# If after 30 second, the device is still initializing (It did not yet connect to Home Assistant), turn off the init_in_progress variable and run the script to refresh the LED status
- delay: 10min
- if:
condition:
lambda: return id(init_in_progress);
then:
- lambda: id(init_in_progress) = false;
- script.execute: control_leds
priority: 600
then:
# Run the script to refresh the LED status
- script.execute: control_leds
# If after 30 second, the device is still initializing (It did not yet connect to Home Assistant), turn off the init_in_progress variable and run the script to refresh the LED status
- delay: 10min
- if:
condition:
lambda: return id(init_in_progress);
then:
- lambda: id(init_in_progress) = false;
- script.execute: control_leds

esp32:
board: esp32-s3-devkitc-1
Expand Down Expand Up @@ -484,7 +484,7 @@ sensor:
condition:
binary_sensor.is_off: center_button
then:
- script.execute:
- script.execute:
id: control_volume
increase_volume: true
- if:
Expand All @@ -509,15 +509,14 @@ sensor:
condition:
binary_sensor.is_off: center_button
then:
- script.execute:
- script.execute:
id: control_volume
increase_volume: false
else:
- script.execute:
id: control_hue
increase_hue: false


- platform: debug
free:
name: "Heap Free"
Expand Down Expand Up @@ -731,21 +730,19 @@ script:
id: voice_assistant_leds
effect: "Timer Ring"



# Script executed when the volume is increased/decreased from the dial
- id: control_volume
mode: restart
parameters:
increase_volume: bool #True: Increase volume / False: Decrease volume.
increase_volume: bool # True: Increase volume / False: Decrease volume.
then:
- delay: 16ms
- if:
condition:
lambda: return increase_volume;
then:
- media_player.volume_up:
else:
else:
- media_player.volume_down:
- delay: 16ms
- lambda: id(dial_touched) = true;
Expand All @@ -761,7 +758,7 @@ script:
- id: control_hue
mode: restart
parameters:
increase_hue: bool #True: Increase volume / False: Decrease volume.
increase_hue: bool # True: Increase volume / False: Decrease volume.
then:
- delay: 16ms
- lambda: |
Expand Down Expand Up @@ -796,7 +793,7 @@ script:
# Script executed when the timer is ringing, to playback sounds.
- id: ring_timer
then:
then:
- while:
condition:
switch.is_on: timer_ringing
Expand All @@ -808,7 +805,7 @@ script:
.set_local_media_file(id(timer_finished_wave_file))
.perform();
- delay: 1s

i2s_audio:
- id: i2s_input
i2s_lrclk_pin:
Expand All @@ -832,8 +829,9 @@ i2s_audio:
number: GPIO9
allow_other_uses: true
i2s_mode: secondary
# i2s_output data pin is gpio10
# i2s_output data pin is gpio10

# yamllint disable rule:comments-indentation
# This describes the second I2S interface between ESP32 and XMOS chip. Currently unused.
# - id: i2s_output
# i2s_lrclk_pin:
Expand All @@ -847,6 +845,7 @@ i2s_audio:
# # allow_other_uses: true
# i2s_mode: primary #secondary
# data line is GPIO15
# yamllint enable rule:comments-indentation

microphone:
- platform: i2s_audio
Expand Down Expand Up @@ -984,4 +983,4 @@ button:
.perform();
debug:
update_interval: 5s
update_interval: 5s

0 comments on commit 11c4e23

Please sign in to comment.