From fd89469dfac47c9392dbc5ddc919b6aa9b6c3f17 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 18 Oct 2024 12:08:04 +0200 Subject: [PATCH] ci: fix yamllint issues --- .yamllint | 28 +++++++ automations.yaml | 1 + configuration.yaml | 2 +- customize/glob/bath.yaml | 1 + customize/glob/bedroom.yaml | 1 + customize/glob/general.yaml | 1 + customize/glob/hall.yaml | 1 + customize/glob/kitchen.yaml | 1 + customize/glob/livingroom.yaml | 1 + customize/glob/office.yaml | 1 + lovelace/views/view_0_home.yaml | 13 +-- lovelace/views/view_10_light.yaml | 31 +++---- lovelace/views/view_20_vacuum.yaml | 19 ++--- lovelace/views/view_90_maintenance.yaml | 13 +-- packages/zigbee2mqtt.yaml | 3 +- templates/bath.yaml | 43 +++++----- templates/kitchen.yaml | 25 +++--- templates/office.yaml | 43 +++++----- templates/roborock.yaml | 102 ++++++++++++------------ ui-lovelace.yaml | 1 + 20 files changed, 190 insertions(+), 141 deletions(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..fd8248f --- /dev/null +++ b/.yamllint @@ -0,0 +1,28 @@ +--- +extends: default + +ignore: | + *.sops.* + flux/clusters/**/flux-system/gotk-*.yaml + terraform/ + ansible/ + +rules: + truthy: + allowed-values: ["True", "False"] + comments: + min-spaces-from-content: 1 + ignore: | + user-data.yaml + line-length: disable + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + indentation: enable + document-start: + ignore: | + secret.yaml + user-data.yaml diff --git a/automations.yaml b/automations.yaml index 181d32d..76d1a2c 100644 --- a/automations.yaml +++ b/automations.yaml @@ -1,3 +1,4 @@ +--- - id: bf5457c9-3494-49e7-b504-cab0587be871 alias: Starte Staubsauger triggers: diff --git a/configuration.yaml b/configuration.yaml index 2b1a813..b01ca74 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -66,4 +66,4 @@ automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml -template: !include_dir_merge_list templates/ +template: !include_dir_list templates/ diff --git a/customize/glob/bath.yaml b/customize/glob/bath.yaml index 2f29538..1bb42d1 100644 --- a/customize/glob/bath.yaml +++ b/customize/glob/bath.yaml @@ -1,3 +1,4 @@ +--- "light.bath_light": friendly_name: Alle Lampen "*.bath_lamp_sideboard": diff --git a/customize/glob/bedroom.yaml b/customize/glob/bedroom.yaml index 543f93f..9bac5ba 100644 --- a/customize/glob/bedroom.yaml +++ b/customize/glob/bedroom.yaml @@ -1,3 +1,4 @@ +--- "light.bedroom_light": friendly_name: Alle Lampen "*.bedroom_lamp_nightstand_left": diff --git a/customize/glob/general.yaml b/customize/glob/general.yaml index e8c2179..f617fa8 100644 --- a/customize/glob/general.yaml +++ b/customize/glob/general.yaml @@ -1,2 +1,3 @@ +--- "light.all": friendly_name: Alle Lampen diff --git a/customize/glob/hall.yaml b/customize/glob/hall.yaml index 9eb07c2..ccb02a9 100644 --- a/customize/glob/hall.yaml +++ b/customize/glob/hall.yaml @@ -1,3 +1,4 @@ +--- "light.hall_light": friendly_name: Alle Lampen "*.hall_lamp_sideboard": diff --git a/customize/glob/kitchen.yaml b/customize/glob/kitchen.yaml index e96a6d9..13caab1 100644 --- a/customize/glob/kitchen.yaml +++ b/customize/glob/kitchen.yaml @@ -1,3 +1,4 @@ +--- "*.kitchen_lamp_cupboard": friendly_name: Küchenzeile diff --git a/customize/glob/livingroom.yaml b/customize/glob/livingroom.yaml index da10938..8ec3681 100644 --- a/customize/glob/livingroom.yaml +++ b/customize/glob/livingroom.yaml @@ -1,3 +1,4 @@ +--- "light.livingroom_light": friendly_name: Alle Lampen "*.livingroom_lamp_bookshelf": diff --git a/customize/glob/office.yaml b/customize/glob/office.yaml index fe406b3..a8346e9 100644 --- a/customize/glob/office.yaml +++ b/customize/glob/office.yaml @@ -1,3 +1,4 @@ +--- "light.office_light": friendly_name: Alle Lampen "*.office_lamp_bookshelf": diff --git a/lovelace/views/view_0_home.yaml b/lovelace/views/view_0_home.yaml index e432865..d528f94 100644 --- a/lovelace/views/view_0_home.yaml +++ b/lovelace/views/view_0_home.yaml @@ -1,13 +1,14 @@ +--- title: Home path: home icon: mdi:home cards: - type: custom:weather-card entity: weather.forecast_home - current: true - details: false - forecast: true - hourly_forecast: false + current: True + details: False + forecast: True + hourly_forecast: False number_of_forecasts: 5 - type: entities @@ -21,7 +22,7 @@ cards: - entity: sensor.livingroom_sensor_temperature_temperature name: Luft icon: mdi:air-filter - show_state: false + show_state: False type: custom:multiple-entity-row entities: - entity: sensor.livingroom_sensor_temperature_temperature @@ -33,7 +34,7 @@ cards: label: Küche - entity: binary_sensor.ki_fridge_door_sensor_contact_state name: Kühlschrank - show_state: false + show_state: False type: custom:multiple-entity-row entities: - entity: sensor.kitchen_sensor_temperature_fridge_temperature diff --git a/lovelace/views/view_10_light.yaml b/lovelace/views/view_10_light.yaml index 9a5c599..d826c42 100644 --- a/lovelace/views/view_10_light.yaml +++ b/lovelace/views/view_10_light.yaml @@ -1,10 +1,11 @@ +--- title: Licht path: light icon: mdi:lightbulb-outline cards: - type: entities title: Wohnzimmer - show_header_toggle: false + show_header_toggle: False entities: - entity: light.livingroom_light - type: custom:fold-entity-row @@ -16,26 +17,26 @@ cards: - entity: light.livingroom_lamp_bookshelf - type: custom:slider-entity-row entity: light.livingroom_lamp_bookshelf - full_row: true + full_row: True # livingroom_lamp_floor - entity: light.livingroom_lamp_floor - type: custom:slider-entity-row entity: light.livingroom_lamp_floor - full_row: true + full_row: True # livingroom_lamp_ambience - entity: light.livingroom_lamp_ambience - type: custom:slider-entity-row entity: light.livingroom_lamp_ambience - full_row: true + full_row: True # kitchen_lamp_cupboard - entity: light.kitchen_lamp_cupboard - type: custom:slider-entity-row entity: light.kitchen_lamp_cupboard - full_row: true + full_row: True - type: entities title: Büro - show_header_toggle: false + show_header_toggle: False entities: - entity: light.office_light - type: custom:fold-entity-row @@ -47,16 +48,16 @@ cards: - entity: light.office_lamp_bookshelf - type: custom:slider-entity-row entity: light.office_lamp_bookshelf - full_row: true + full_row: True # office_lamp_floor - entity: light.office_lamp_floor - type: custom:slider-entity-row entity: light.office_lamp_floor - full_row: true + full_row: True - type: entities title: Schlafzimmer - show_header_toggle: false + show_header_toggle: False entities: - entity: light.bedroom_light - type: custom:fold-entity-row @@ -68,16 +69,16 @@ cards: - entity: light.bedroom_lamp_nightstand_right - type: custom:slider-entity-row entity: light.bedroom_lamp_nightstand_right - full_row: true + full_row: True # bedroom_lamp_nightstand_left - entity: light.bedroom_lamp_nightstand_left - type: custom:slider-entity-row entity: light.bedroom_lamp_nightstand_left - full_row: true + full_row: True - type: entities title: Flur - show_header_toggle: false + show_header_toggle: False entities: - entity: light.hall_light - type: custom:fold-entity-row @@ -89,11 +90,11 @@ cards: - entity: light.hall_lamp_sideboard - type: custom:slider-entity-row entity: light.hall_lamp_sideboard - full_row: true + full_row: True - type: entities title: Bad - show_header_toggle: false + show_header_toggle: False entities: - entity: light.bath_light - type: custom:fold-entity-row @@ -105,4 +106,4 @@ cards: - entity: light.bath_lamp_sideboard - type: custom:slider-entity-row entity: light.bath_lamp_sideboard - full_row: true + full_row: True diff --git a/lovelace/views/view_20_vacuum.yaml b/lovelace/views/view_20_vacuum.yaml index 6d0ff42..ace7580 100644 --- a/lovelace/views/view_20_vacuum.yaml +++ b/lovelace/views/view_20_vacuum.yaml @@ -1,3 +1,4 @@ +--- title: Staubsauger path: vacuum icon: mdi:robot-vacuum @@ -15,18 +16,18 @@ cards: floor_color: "#03a9f4" wall_color: "#263238" no_go_area_color: "#d84315" - show_dock: false - show_battery_level: false - show_start_button: false - show_pause_button: false - show_stop_button: false - show_home_button: false - show_locate_button: false - show_status: false + show_dock: False + show_battery_level: False + show_start_button: False + show_pause_button: False + show_stop_button: False + show_home_button: False + show_locate_button: False + show_status: False vacuum_color: "#FFFFFF" - type: custom:vacuum-card entity: vacuum.valetudo_rockrobo - compact_view: false + compact_view: False image: /local/icons/robot.svg stats: cleaning: diff --git a/lovelace/views/view_90_maintenance.yaml b/lovelace/views/view_90_maintenance.yaml index 8f2d3a7..e08c8ef 100644 --- a/lovelace/views/view_90_maintenance.yaml +++ b/lovelace/views/view_90_maintenance.yaml @@ -1,3 +1,4 @@ +--- title: Wartung path: maintenance icon: mdi:tools @@ -13,8 +14,8 @@ cards: sort: method: attribute attribute: "battery" - reverse: false - show_empty: false + reverse: False + show_empty: False - type: custom:auto-entities card: @@ -27,18 +28,18 @@ cards: update:state: available options: icon: mdi:update - state_color: false + state_color: False - entity_id: "update.*" attributes: update:state: updating options: icon: mdi:progress-wrench - state_color: false + state_color: False sort: method: attribute attribute: "battery" - reverse: false - show_empty: false + reverse: False + show_empty: False - type: entities title: Zigbee2MQTT diff --git a/packages/zigbee2mqtt.yaml b/packages/zigbee2mqtt.yaml index 47aad67..9d369ea 100644 --- a/packages/zigbee2mqtt.yaml +++ b/packages/zigbee2mqtt.yaml @@ -1,3 +1,4 @@ +--- zigbee2mqtt: # Input select for Zigbee2MQTT debug level input_select: @@ -37,7 +38,7 @@ zigbee2mqtt: input_boolean: zigbee2mqtt_force_remove: name: Zigbee2MQTT Force Remove - initial: false + initial: False icon: mdi:alert-remove # Scripts for renaming & removing devices diff --git a/templates/bath.yaml b/templates/bath.yaml index 53d8012..0244144 100644 --- a/templates/bath.yaml +++ b/templates/bath.yaml @@ -1,22 +1,23 @@ -- sensor: - - name: bath_sensor_air_quality_rating - unit_of_measurement: ppb - state: "{{ states('sensor.bath_sensor_air_quality_voc') | float(0) }}" - icon: > - {% if states.sensor.bath_sensor_air_quality_voc.state is defined %} - {% if not is_state('sensor.bath_sensor_air_quality_voc', ['unknown', 'unavailable']) %} - {% if float(states('sensor.bath_sensor_air_quality_voc')) < 150 %} - mdi:star-circle - {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 150 and float(states('sensor.bath_sensor_air_quality_voc')) < 400 %} - mdi:star-circle-outline - {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 400 and float(states('sensor.bath_sensor_air_quality_voc')) < 1300 %} - mdi:check-circle-outline - {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 1300 and float(states('sensor.bath_sensor_air_quality_voc')) < 4000 %} - mdi:alert-circle-outline - {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 4000 %} - mdi:radioactive-circle-outline - {% endif %} - {% else %} - mdi:circle-off-outline - {% endif %} +--- +sensor: + - name: bath_sensor_air_quality_rating + unit_of_measurement: ppb + state: "{{ states('sensor.bath_sensor_air_quality_voc') | float(0) }}" + icon: > + {% if states.sensor.bath_sensor_air_quality_voc.state is defined %} + {% if not is_state('sensor.bath_sensor_air_quality_voc', ['unknown', 'unavailable']) %} + {% if float(states('sensor.bath_sensor_air_quality_voc')) < 150 %} + mdi:star-circle + {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 150 and float(states('sensor.bath_sensor_air_quality_voc')) < 400 %} + mdi:star-circle-outline + {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 400 and float(states('sensor.bath_sensor_air_quality_voc')) < 1300 %} + mdi:check-circle-outline + {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 1300 and float(states('sensor.bath_sensor_air_quality_voc')) < 4000 %} + mdi:alert-circle-outline + {% elif float(states('sensor.bath_sensor_air_quality_voc')) >= 4000 %} + mdi:radioactive-circle-outline {% endif %} + {% else %} + mdi:circle-off-outline + {% endif %} + {% endif %} diff --git a/templates/kitchen.yaml b/templates/kitchen.yaml index bb8200c..9cea24b 100644 --- a/templates/kitchen.yaml +++ b/templates/kitchen.yaml @@ -1,12 +1,13 @@ -- binary_sensor: - - name: ki_fridge_door_sensor_contact_state - state: "{{ states('binary_sensor.ki_fridge_door_sensor_contact') }}" - device_class: door - icon: > - {% if states.binary_sensor.ki_fridge_door_sensor_contact.state is defined %} - {% if is_state('binary_sensor.ki_fridge_door_sensor_contact', 'off') %} - mdi:fridge-industrial - {% else %} - mdi:fridge-industrial-alert-outline - {% endif %} - {% endif %} +--- +binary_sensor: + - name: ki_fridge_door_sensor_contact_state + state: "{{ states('binary_sensor.ki_fridge_door_sensor_contact') }}" + device_class: door + icon: > + {% if states.binary_sensor.ki_fridge_door_sensor_contact.state is defined %} + {% if is_state('binary_sensor.ki_fridge_door_sensor_contact', 'off') %} + mdi:fridge-industrial + {% else %} + mdi:fridge-industrial-alert-outline + {% endif %} + {% endif %} diff --git a/templates/office.yaml b/templates/office.yaml index 07b915e..b6e8255 100644 --- a/templates/office.yaml +++ b/templates/office.yaml @@ -1,22 +1,23 @@ -- sensor: - - name: office_sensor_air_quality_rating - unit_of_measurement: ppb - state: "{{ states('sensor.office_sensor_air_quality_voc') | float(0) }}" - icon: > - {% if states.sensor.office_sensor_air_quality_voc.state is defined %} - {% if not is_state('sensor.office_sensor_air_quality_voc', ['unknown', 'unavailable']) %} - {% if float(states('sensor.office_sensor_air_quality_voc')) < 150 %} - mdi:star-circle - {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 150 and float(states('sensor.office_sensor_air_quality_voc')) < 400 %} - mdi:star-circle-outline - {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 400 and float(states('sensor.office_sensor_air_quality_voc')) < 1300 %} - mdi:check-circle-outline - {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 1300 and float(states('sensor.office_sensor_air_quality_voc')) < 4000 %} - mdi:alert-circle-outline - {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 4000 %} - mdi:radioactive-circle-outline - {% endif %} - {% else %} - mdi:circle-off-outline - {% endif %} +--- +sensor: + - name: office_sensor_air_quality_rating + unit_of_measurement: ppb + state: "{{ states('sensor.office_sensor_air_quality_voc') | float(0) }}" + icon: > + {% if states.sensor.office_sensor_air_quality_voc.state is defined %} + {% if not is_state('sensor.office_sensor_air_quality_voc', ['unknown', 'unavailable']) %} + {% if float(states('sensor.office_sensor_air_quality_voc')) < 150 %} + mdi:star-circle + {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 150 and float(states('sensor.office_sensor_air_quality_voc')) < 400 %} + mdi:star-circle-outline + {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 400 and float(states('sensor.office_sensor_air_quality_voc')) < 1300 %} + mdi:check-circle-outline + {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 1300 and float(states('sensor.office_sensor_air_quality_voc')) < 4000 %} + mdi:alert-circle-outline + {% elif float(states('sensor.office_sensor_air_quality_voc')) >= 4000 %} + mdi:radioactive-circle-outline {% endif %} + {% else %} + mdi:circle-off-outline + {% endif %} + {% endif %} diff --git a/templates/roborock.yaml b/templates/roborock.yaml index b67dc18..851a611 100644 --- a/templates/roborock.yaml +++ b/templates/roborock.yaml @@ -1,53 +1,57 @@ -- sensor: - - name: valetudo_rockrobo_main_filter_duration - state: >- - {% set minutes = states("sensor.valetudo_rockrobo_main_filter") | int(0) %} - {% set hours = ((minutes % 1440) / 60) | int %} - {% set days = (minutes / 1440) | int %} - {%- if minutes >= 60 -%} - {%- if days > 0 %}{{ days }}d{% endif -%} - {%- if hours > 0 -%} - {{ ' ' + hours | string if days > 0 else hours }}h - {%- endif -%} - {%- else -%} - {{ minutes }}min +--- +sensor: + - name: valetudo_rockrobo_main_filter_duration + state: >- + {% set minutes = states("sensor.valetudo_rockrobo_main_filter") | int(0) %} + {% set hours = ((minutes % 1440) / 60) | int %} + {% set days = (minutes / 1440) | int %} + {%- if minutes >= 60 -%} + {%- if days > 0 %}{{ days }}d{% endif -%} + {%- if hours > 0 -%} + {{ ' ' + hours | string if days > 0 else hours }}h {%- endif -%} - - name: valetudo_rockrobo_right_brush_duration - state: >- - {% set minutes = states("sensor.valetudo_rockrobo_right_brush") | int(0) %} - {% set hours = ((minutes % 1440) / 60) | int %} - {% set days = (minutes / 1440) | int %} - {%- if minutes >= 60 -%} - {%- if days > 0 %}{{ days }}d{% endif -%} - {%- if hours > 0 -%} - {{ ' ' + hours | string if days > 0 else hours }}h - {%- endif -%} - {%- else -%} - {{ minutes }}min + {%- else -%} + {{ minutes }}min + {%- endif -%} + + - name: valetudo_rockrobo_right_brush_duration + state: >- + {% set minutes = states("sensor.valetudo_rockrobo_right_brush") | int(0) %} + {% set hours = ((minutes % 1440) / 60) | int %} + {% set days = (minutes / 1440) | int %} + {%- if minutes >= 60 -%} + {%- if days > 0 %}{{ days }}d{% endif -%} + {%- if hours > 0 -%} + {{ ' ' + hours | string if days > 0 else hours }}h {%- endif -%} - - name: valetudo_rockrobo_main_brush_duration - state: >- - {% set minutes = states("sensor.valetudo_rockrobo_main_brush") | int(0) %} - {% set hours = ((minutes % 1440) / 60) | int %} - {% set days = (minutes / 1440) | int %} - {%- if minutes >= 60 -%} - {%- if days > 0 %}{{ days }}d{% endif -%} - {%- if hours > 0 -%} - {{ ' ' + hours | string if days > 0 else hours }}h - {%- endif -%} - {%- else -%} - {{ minutes }}min + {%- else -%} + {{ minutes }}min + {%- endif -%} + + - name: valetudo_rockrobo_main_brush_duration + state: >- + {% set minutes = states("sensor.valetudo_rockrobo_main_brush") | int(0) %} + {% set hours = ((minutes % 1440) / 60) | int %} + {% set days = (minutes / 1440) | int %} + {%- if minutes >= 60 -%} + {%- if days > 0 %}{{ days }}d{% endif -%} + {%- if hours > 0 -%} + {{ ' ' + hours | string if days > 0 else hours }}h {%- endif -%} - - name: valetudo_rockrobo_sensor_duration - state: >- - {% set minutes = states("sensor.valetudo_rockrobo_sensor_cleaning") | int(0) %} - {% set hours = ((minutes % 1440) / 60) | int %} - {% set days = (minutes / 1440) | int %} - {%- if minutes >= 60 -%} - {%- if days > 0 %}{{ days }}d{% endif -%} - {%- if hours > 0 -%} - {{ ' ' + hours | string if days > 0 else hours }}h - {%- endif -%} - {%- else -%} - {{ minutes }}min + {%- else -%} + {{ minutes }}min + {%- endif -%} + + - name: valetudo_rockrobo_sensor_duration + state: >- + {% set minutes = states("sensor.valetudo_rockrobo_sensor_cleaning") | int(0) %} + {% set hours = ((minutes % 1440) / 60) | int %} + {% set days = (minutes / 1440) | int %} + {%- if minutes >= 60 -%} + {%- if days > 0 %}{{ days }}d{% endif -%} + {%- if hours > 0 -%} + {{ ' ' + hours | string if days > 0 else hours }}h {%- endif -%} + {%- else -%} + {{ minutes }}min + {%- endif -%} diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 9e9b2bc..d538bba 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -1,2 +1,3 @@ +--- title: Apartment views: !include_dir_list lovelace/views/