hassio-conf/templates/roborock.yaml
Robert Kaussow fd89469dfa
Some checks failed
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/push/notify Pipeline was successful
ci: fix yamllint issues
2024-10-18 12:08:04 +02:00

58 lines
2.0 KiB
YAML

---
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
{%- 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
{%- 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
{%- 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 -%}