From 830e9566ad260fc343d239a305bcd29feb98f529 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Fri, 20 May 2022 11:29:50 +0200 Subject: [PATCH] Make variables uniform Easier to use with different types of cards --- .../card_templates/cards/card_battery.yaml | 4 ++-- .../card_templates/cards/card_binary_sensor.yaml | 4 ++-- .../cards/card_binary_sensor_alert.yaml | 4 ++-- .../card_templates/cards/card_generic.yaml | 4 ++-- .../card_templates/cards/card_generic_swap.yaml | 4 ++-- .../card_templates/cards/card_input_boolean.yaml | 4 ++-- .../card_templates/cards/card_light.yaml | 12 ++++++------ .../card_templates/cards/card_media_player.yaml | 12 ++++++------ .../card_templates/cards/card_power_outlet.yaml | 4 ++-- .../card_templates/cards/card_thermostat.yaml | 12 ++++++------ 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml index 797c97aaf..85d197da9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml @@ -8,8 +8,8 @@ card_battery: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_battery_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_battery_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" tap_action: action: "more-info" variables: diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml index 2da7153f7..7319890d7 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml @@ -10,5 +10,5 @@ card_binary_sensor: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_binary_sensor_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_binary_sensor_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml index fb92544f0..441fc20b7 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml @@ -9,5 +9,5 @@ card_binary_sensor_alert: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_binary_senor_alert_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_binary_senor_alert_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml index cb9ea8cdc..3e73d1f7a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml @@ -8,8 +8,8 @@ card_generic: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_generic_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_generic_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" label: > [[[ var unit = entity.attributes.unit_of_measurement != null ? " " + entity.attributes.unit_of_measurement : "" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml index f266c3696..d746c025b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml @@ -8,8 +8,8 @@ card_generic_swap: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_generic_swap_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_generic_swap_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" label: > [[[ var unit = entity.attributes.unit_of_measurement != null ? " " + entity.attributes.unit_of_measurement : "" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml index fea3db52c..0dbc06b66 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml @@ -9,8 +9,8 @@ card_input_boolean: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_input_boolean_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_input_boolean_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" name: "[[[ return entity.attributes.friendly_name != '' ? entity.attributes.friendly_name : entity.entity_id ]]]" label: > [[[ diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml index 0286f6271..52f3bcff5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml @@ -24,8 +24,8 @@ card_light: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_light_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_light_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ @@ -134,8 +134,8 @@ card_light: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_light_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_light_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ @@ -193,8 +193,8 @@ card_light: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_light_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_light_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml index fd23a239f..6fea84529 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml @@ -21,8 +21,8 @@ card_media_player: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_media_player_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_media_player_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ @@ -121,8 +121,8 @@ card_media_player: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_media_player_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_media_player_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ @@ -258,8 +258,8 @@ card_media_player: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_media_player_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_media_player_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml index eb84e75c5..5c9610775 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml @@ -12,8 +12,8 @@ card_power_outlet: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_power_outlet_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_power_outlet_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" label: |- [[[ if (entity.state === "on" && variables.ulm_card_power_outlet_consumption_sensor !== null) { diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml index fffeb25fb..8339c54b2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml @@ -21,8 +21,8 @@ card_thermostat: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_thermostat_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_thermostat_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ @@ -181,8 +181,8 @@ card_thermostat: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_thermostat_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_thermostat_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" hold_action: action: > [[[ @@ -232,8 +232,8 @@ card_thermostat: action: "call-service" service: "input_select.select_option" service_data: - option: "[[[ return variables.ulm_card_thermostat_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_card_thermostat_input_select ]]]" + option: "[[[ return variables.ulm_input_select_option ]]]" + entity_id: "[[[ return variables.ulm_input_select ]]]" tap_action: action: "call-service" service: >