From 0bef65867628f5080a596ccc4cb5de2235f1a00b Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 6 Aug 2022 21:05:05 +0200 Subject: [PATCH 01/21] Add call-service as action to custom actions. --- .../ulm_templates/actions/actions_card.yaml | 81 ++++++++++++++++--- .../ulm_templates/actions/actions_icon.yaml | 81 ++++++++++++++++--- .../ulm_templates/actions/actions_name.yaml | 81 ++++++++++++++++--- .../internal_templates/extended_card.yaml | 18 +++++ .../icon_more_info_alert.yaml | 12 +++ .../icon_more_info_new.yaml | 12 +++ docs/setup/custom_actions.md | 44 ++++++++++ 7 files changed, 293 insertions(+), 36 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index 44e647d02..ccb070be5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -34,10 +34,29 @@ ulm_actions_card: ]]] navigation_path: "[[[ return variables.ulm_card_tap_action == 'navigate' ? variables.ulm_card_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_tap_haptic != null ? variables.ulm_card_tap_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_card_tap_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_card_tap_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_card_tap_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_card_tap_service_data; + ]]] browser_mod: command: "popup" large: true @@ -106,10 +125,29 @@ ulm_actions_card: ]]] navigation_path: "[[[ return variables.ulm_card_hold_action == 'navigate' ? variables.ulm_card_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_hold_haptic != null ? variables.ulm_card_hold_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_card_hold_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_card_hold_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_card_hold_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_card_hold_service_data; + ]]] browser_mod: command: "popup" large: true @@ -178,10 +216,29 @@ ulm_actions_card: ]]] navigation_path: "[[[ return variables.ulm_card_double_tap_action == 'navigate' ? variables.ulm_card_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_double_tap_haptic != null ? variables.ulm_card_double_tap_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_card_double_tap_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_card_double_tap_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_card_double_tap_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_card_double_tap_service_data; + ]]] browser_mod: command: "popup" large: true diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index e4f6e7418..97877e6a8 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -34,10 +34,29 @@ ulm_actions_icon: ]]] navigation_path: "[[[ return variables.ulm_icon_tap_action == 'navigate' ? variables.ulm_icon_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_icon_tap_haptic != null ? variables.ulm_icon_tap_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_icon_tap_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_icon_tap_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_icon_tap_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_icon_tap_service_data; + ]]] browser_mod: command: "popup" large: true @@ -116,10 +135,29 @@ ulm_actions_icon: ]]] navigation_path: "[[[ return variables.ulm_icon_hold_action == 'navigate' ? variables.ulm_icon_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_icon_hold_haptic != null ? variables.ulm_icon_hold_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_icon_hold_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_icon_hold_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_icon_hold_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_icon_hold_service_data; + ]]] browser_mod: command: "popup" large: true @@ -202,10 +240,29 @@ ulm_actions_icon: ]]] navigation_path: "[[[ return variables.ulm_icon_double_tap_action == 'navigate' ? variables.ulm_icon_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_icon_double_tap_haptic != null ? variables.ulm_icon_double_tap_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_icon_double_tap_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_icon_double_tap_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_icon_double_tap_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_icon_double_tap_service_data; + ]]] browser_mod: command: "popup" large: true diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 6140e4ab9..5319c7550 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -34,10 +34,29 @@ ulm_actions_name: ]]] navigation_path: "[[[ return variables.ulm_name_tap_action == 'navigate' ? variables.ulm_name_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_name_tap_haptic != null ? variables.ulm_name_tap_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_name_tap_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_name_tap_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_name_tap_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_name_tap_service_data; + ]]] browser_mod: command: "popup" large: true @@ -106,10 +125,29 @@ ulm_actions_name: ]]] navigation_path: "[[[ return variables.ulm_name_hold_action == 'navigate' ? variables.ulm_name_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_name_hold_haptic != null ? variables.ulm_name_hold_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_name_hold_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_name_hold_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_name_hold_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_card_name_service_data; + ]]] browser_mod: command: "popup" large: true @@ -178,10 +216,29 @@ ulm_actions_name: ]]] navigation_path: "[[[ return variables.ulm_name_double_tap_action == 'navigate' ? variables.ulm_name_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_name_double_tap_haptic != null ? variables.ulm_name_double_tap_haptic : 'none' ]]]" - service: "input_select.select_option" - service_data: - option: "[[[ return variables.ulm_input_select_option ]]]" - entity_id: "[[[ return variables.ulm_input_select ]]]" + service: > + [[[ + var action = variables.ulm_name_double_tap_action; + + if (action == 'adaptive'){ + return 'input_select.select_option'; + } + + return variables.ulm_name_double_tap_service; + ]]] + service_data: > + [[[ + var action = variables.ulm_name_double_tap_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_name_double_tap_service_data; + ]]] browser_mod: command: "popup" large: true diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml index 19ee39753..ec86a3f34 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml @@ -28,30 +28,48 @@ extended_card: ulm_card_tap_action: "[[[ return variables.ulm_card_tap_action; ]]]" ulm_card_tap_haptic: "[[[ return variables.ulm_card_tap_haptic; ]]]" ulm_card_tap_navigate_path: "[[[ return variables.ulm_card_tap_navigate_path; ]]]" + ulm_card_tap_service: "[[[ return variables.ulm_card_tap_service; ]]]" + ulm_card_tap_service_data: "[[[ return variables.ulm_card_tap_service_data]]]" ulm_card_hold_action: "[[[ return variables.ulm_card_hold_action; ]]]" ulm_card_hold_haptic: "[[[ return variables.ulm_card_hold_haptic; ]]]" ulm_card_hold_navigate_path: "[[[ return variables.ulm_card_hold_navigate_path; ]]]" + ulm_card_hold_service: "[[[ return variables.ulm_card_hold_service; ]]]" + ulm_card_hold_service_data: "[[[ return variables.ulm_card_hold_service_data]]]" ulm_card_double_tap_action: "[[[ return variables.ulm_card_double_tap_action; ]]]" ulm_card_double_tap_haptic: "[[[ return variables.ulm_card_double_tap_haptic; ]]]" ulm_card_double_tap_navigate_path: "[[[ return variables.ulm_card_double_tap_navigate_path; ]]]" + ulm_card_double_tap_service: "[[[ return variables.ulm_card_double_tap_service; ]]]" + ulm_card_double_tap_service_data: "[[[ return variables.ulm_card_double_tap_service_data]]]" ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_tap_service: "[[[ return variables.ulm_icon_tap_service; ]]]" + ulm_icon_tap_service_data: "[[[ return variables.ulm_icon_tap_service_data]]]" ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_hold_service: "[[[ return variables.ulm_icon_hold_service; ]]]" + ulm_icon_hold_service_data: "[[[ return variables.ulm_icon_hold_service_data]]]" ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_icon_double_tap_service: "[[[ return variables.ulm_icon_double_tap_service; ]]]" + ulm_icon_double_tap_service_data: "[[[ return variables.ulm_icon_double_tap_service_data]]]" ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_tap_service: "[[[ return variables.ulm_name_tap_service; ]]]" + ulm_name_tap_service_data: "[[[ return variables.ulm_name_tap_service_data]]]" ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_hold_service: "[[[ return variables.ulm_name_hold_service; ]]]" + ulm_name_hold_service_data: "[[[ return variables.ulm_name_hold_service_data]]]" ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_name_double_tap_service: "[[[ return variables.ulm_name_double_tap_service; ]]]" + ulm_name_double_tap_service_data: "[[[ return variables.ulm_name_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml index d072ab6f1..7fc2628c8 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml @@ -46,12 +46,18 @@ icon_more_info_alert: ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_tap_service: "[[[ return variables.ulm_icon_tap_service; ]]]" + ulm_icon_tap_service_data: "[[[ return variables.ulm_icon_tap_service_data]]]" ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_hold_service: "[[[ return variables.ulm_icon_hold_service; ]]]" + ulm_icon_hold_service_data: "[[[ return variables.ulm_icon_hold_service_data]]]" ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_icon_double_tap_service: "[[[ return variables.ulm_icon_double_tap_service; ]]]" + ulm_icon_double_tap_service_data: "[[[ return variables.ulm_icon_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: @@ -70,12 +76,18 @@ icon_more_info_alert: ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_tap_service: "[[[ return variables.ulm_name_tap_service; ]]]" + ulm_name_tap_service_data: "[[[ return variables.ulm_name_tap_service_data]]]" ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_hold_service: "[[[ return variables.ulm_name_hold_service; ]]]" + ulm_name_hold_service_data: "[[[ return variables.ulm_name_hold_service_data]]]" ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_name_double_tap_service: "[[[ return variables.ulm_name_double_tap_service; ]]]" + ulm_name_double_tap_service_data: "[[[ return variables.ulm_name_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml index d4c806178..c6f799ea8 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml @@ -46,12 +46,18 @@ icon_more_info_new: ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_tap_service: "[[[ return variables.ulm_icon_tap_service; ]]]" + ulm_icon_tap_service_data: "[[[ return variables.ulm_icon_tap_service_data]]]" ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_hold_service: "[[[ return variables.ulm_icon_hold_service; ]]]" + ulm_icon_hold_service_data: "[[[ return variables.ulm_icon_hold_service_data]]]" ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_icon_double_tap_service: "[[[ return variables.ulm_icon_double_tap_service; ]]]" + ulm_icon_double_tap_service_data: "[[[ return variables.ulm_icon_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: @@ -70,12 +76,18 @@ icon_more_info_new: ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_tap_service: "[[[ return variables.ulm_name_tap_service; ]]]" + ulm_name_tap_service_data: "[[[ return variables.ulm_name_tap_service_data]]]" ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_hold_service: "[[[ return variables.ulm_name_hold_service; ]]]" + ulm_name_hold_service_data: "[[[ return variables.ulm_name_hold_service_data]]]" ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_name_double_tap_service: "[[[ return variables.ulm_name_double_tap_service; ]]]" + ulm_name_double_tap_service_data: "[[[ return variables.ulm_name_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index be80fc9c0..40599aa88 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -101,6 +101,38 @@ To define the path of `navigate` action, add one of the following depending on y ``` +## Call service action + +It is possible to call a service using the custom actions on the icon, name and card. + +To define the service and its data of `call-service` action, add one of the following +variables depending on your action : + +- ulm_card_tap_service / ulm_card_tap_service_data +- ulm_card_hold_service / ulm_card_hold_service_data +- ulm_card_double_tap_service / ulm_card_double_tap_service_data +- ulm_icon_tap_service / ulm_icon_tap_service_data +- ulm_icon_hold_service / ulm_icon_hold_service_data +- ulm_icon_double_tap_service / ulm_icon_double_tap_service_data +- ulm_name_tap_service / ulm_name_tap_service_data +- ulm_name_hold_service / ulm_name_hold_service_data +- ulm_name_double_tap_service / ulm_name_double_tap_service_data + +The following configuration shows the configuration of a service call using the +tap action. + +```yaml +- type: "custom:button-card" + template: "card_cover" + entity: "cover.somfy_portail" + variables: + ulm_name_tap_action: "call-service" + ulm_name_tap_service: "light.toggle" + ulm_name_tap_service_data: + entity_id: light.light_livingroom_2 + +``` + ## Overwrite custom actions When creating a dashboard, custom actions and the haptic feedback can be overwritten on your card definition. @@ -237,12 +269,18 @@ custom_card: ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_tap_service: "[[[ return variables.ulm_icon_tap_service; ]]]" + ulm_icon_tap_service_data: "[[[ return variables.ulm_icon_tap_service_data]]]" ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_hold_service: "[[[ return variables.ulm_icon_hold_service; ]]]" + ulm_icon_hold_service_data: "[[[ return variables.ulm_icon_hold_service_data]]]" ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_icon_double_tap_service: "[[[ return variables.ulm_icon_double_tap_service; ]]]" + ulm_icon_double_tap_service_data: "[[[ return variables.ulm_icon_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" item2: card: @@ -256,12 +294,18 @@ custom_card: ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_tap_service: "[[[ return variables.ulm_name_tap_service; ]]]" + ulm_name_tap_service_data: "[[[ return variables.ulm_name_tap_service_data]]]" ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_hold_service: "[[[ return variables.ulm_name_hold_service; ]]]" + ulm_name_hold_service_data: "[[[ return variables.ulm_name_hold_service_data]]]" ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_name_double_tap_service: "[[[ return variables.ulm_name_double_tap_service; ]]]" + ulm_name_double_tap_service_data: "[[[ return variables.ulm_name_double_tap_service_data]]]" ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" ``` From 54b06d34ef7d75a185fcab6f34c5be3ccede039b Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 8 Aug 2022 17:58:08 +0200 Subject: [PATCH 02/21] Text-overflow pills --- .../card_templates/cards/card_welcome_scenes.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml index cacd234d7..8636c7484 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_welcome_scenes.yaml @@ -396,15 +396,17 @@ card_scenes_pill_welcome: grid: - grid-template-areas: "n" name: + - justify-self: "center" - font-weight: "bold" - font-size: "9.5px" - - width: "33px" - padding-bottom: "7px" + - overflow: "[[[return (entity.state !== 'on' && entity.state !== 'playing' && entity.state != variables?.state) ? 'visible' : 'hidden']]]" card: - box-shadow: "none" - padding: "0px 5px 5px 5px" - margin-top: "-5px" - border-radius: "50px" + - overflow: "[[[return (entity.state !== 'on' && entity.state !== 'playing' && entity.state != variables?.state) ? 'visible' : 'hidden']]]" card_topbar_welcome: show_icon: false show_name: false From 8cbb65880add5219dbc974feb4d41b281f90e5e0 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 8 Aug 2022 17:59:23 +0200 Subject: [PATCH 03/21] Text-overflow Light-popup --- .../popup_templates/popups/popup_light_brightness.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index 4ca68e991..d0cb0608d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -272,6 +272,7 @@ popup_light_brightness: - "popup_button_color_temp" styles: card: + - overflow: "visible" - display: > [[[ var color_temp_modes = ["color_temp"]; From 9d845bb652a224d0418df3ecc6b2791c20f6ed5f Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 8 Aug 2022 20:36:32 +0200 Subject: [PATCH 04/21] Change to new framework --- .../lovelace/adaptive-dash/popup/popup.yaml | 70 +++++++------------ 1 file changed, 25 insertions(+), 45 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/adaptive-dash/popup/popup.yaml b/custom_components/ui_lovelace_minimalist/lovelace/adaptive-dash/popup/popup.yaml index ed6320fac..eb7bd1104 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/adaptive-dash/popup/popup.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/adaptive-dash/popup/popup.yaml @@ -17,146 +17,126 @@ states: # light 1: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 2: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 3: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 4: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 5: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 6: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 7: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 8: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 9: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # light 10: # type: "custom:button-card" # template: "popup_light_brightness" - # variables: - # ulm_popup_light_entity: + # entity: # ### Mediaplayers # mediaplayer 1: # type: "custom:button-card" # template: "popup_media_player_infos" - # variables: - # ulm_popup_media_player_entity: + # entity: # mediaplayer 2: # type: "custom:button-card" # template: "popup_media_player_infos" - # variables: - # ulm_popup_media_player_entity: + # entity: # mediaplayer 3: # type: "custom:button-card" # template: "popup_media_player_infos" - # variables: - # ulm_popup_media_player_entity: + # entity: # mediaplayer 4: # type: "custom:button-card" # template: "popup_media_player_infos" - # variables: - # ulm_popup_media_player_entity: + # entity: # mediaplayer 5: # type: "custom:button-card" # template: "popup_media_player_infos" - # variables: - # ulm_popup_media_player_entity: + # entity: # ### Thermostats # climate 1: # type: "custom:button-card" # template: "popup_thermostat_temperature" - # variables: - # ulm_popup_thermostat_entity: + # entity: # climate 2: # type: "custom:button-card" # template: "popup_thermostat_temperature" - # variables: - # ulm_popup_thermostat_entity: + # entity: # climate 3: # type: "custom:button-card" # template: "popup_thermostat_temperature" - # variables: - # ulm_popup_thermostat_entity: + # entity: # climate 4: # type: "custom:button-card" # template: "popup_thermostat_temperature" - # variables: - # ulm_popup_thermostat_entity: + # entity: # climate 5: # type: "custom:button-card" # template: "popup_thermostat_temperature" - # variables: - # ulm_popup_thermostat_entity: + # entity: # ### Power # power 1: # type: "custom:button-card" # template: "popup_power_outlet_stats" + # entity: # variables: - # ulm_popup_power_outlet_entity: # ulm_popup_power_outlet_sensor1: # ulm_popup_power_outlet_sensor2: # ulm_popup_power_outlet_graph_sensor: # power 2: # type: "custom:button-card" # template: "popup_power_outlet_stats" + # entity: # variables: - # ulm_popup_power_outlet_entity: # ulm_popup_power_outlet_sensor1: # ulm_popup_power_outlet_sensor2: # ulm_popup_power_outlet_graph_sensor: # power 3: # type: "custom:button-card" # template: "popup_power_outlet_stats" + # entity: # variables: - # ulm_popup_power_outlet_entity: # ulm_popup_power_outlet_sensor1: # ulm_popup_power_outlet_sensor2: # ulm_popup_power_outlet_graph_sensor: # power 4: # type: "custom:button-card" # template: "popup_power_outlet_stats" + # entity: # variables: - # ulm_popup_power_outlet_entity: # ulm_popup_power_outlet_sensor1: # ulm_popup_power_outlet_sensor2: # ulm_popup_power_outlet_graph_sensor: # power 5: # type: "custom:button-card" # template: "popup_power_outlet_stats" + # entity: # variables: - # ulm_popup_power_outlet_entity: # ulm_popup_power_outlet_sensor1: # ulm_popup_power_outlet_sensor2: # ulm_popup_power_outlet_graph_sensor: From 1643cf9a40c72a71f19822416668ec8d3babe65e Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 8 Aug 2022 20:39:55 +0200 Subject: [PATCH 05/21] Code Quality --- .../lovelace/ulm_templates/actions/actions_card.yaml | 6 +++--- .../lovelace/ulm_templates/actions/actions_icon.yaml | 6 +++--- .../lovelace/ulm_templates/actions/actions_name.yaml | 6 +++--- docs/setup/custom_actions.md | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index ccb070be5..082fb5236 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -47,7 +47,7 @@ ulm_actions_card: service_data: > [[[ var action = variables.ulm_card_tap_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, @@ -138,7 +138,7 @@ ulm_actions_card: service_data: > [[[ var action = variables.ulm_card_hold_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, @@ -229,7 +229,7 @@ ulm_actions_card: service_data: > [[[ var action = variables.ulm_card_double_tap_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index 97877e6a8..b0e7d63ef 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -47,7 +47,7 @@ ulm_actions_icon: service_data: > [[[ var action = variables.ulm_icon_tap_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, @@ -148,7 +148,7 @@ ulm_actions_icon: service_data: > [[[ var action = variables.ulm_icon_hold_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, @@ -253,7 +253,7 @@ ulm_actions_icon: service_data: > [[[ var action = variables.ulm_icon_double_tap_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 5319c7550..1c34c77bb 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -47,7 +47,7 @@ ulm_actions_name: service_data: > [[[ var action = variables.ulm_name_tap_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, @@ -138,7 +138,7 @@ ulm_actions_name: service_data: > [[[ var action = variables.ulm_name_hold_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, @@ -229,7 +229,7 @@ ulm_actions_name: service_data: > [[[ var action = variables.ulm_name_double_tap_action; - + if (action == 'adaptive'){ return { 'option': variables.ulm_input_select_option, diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index 40599aa88..ac60643df 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -128,9 +128,9 @@ tap action. variables: ulm_name_tap_action: "call-service" ulm_name_tap_service: "light.toggle" - ulm_name_tap_service_data: + ulm_name_tap_service_data: entity_id: light.light_livingroom_2 - + ``` ## Overwrite custom actions From 85d3f7c1794c54ed02bf68cf56a468a67e32cee8 Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 14 Aug 2022 11:27:31 +0200 Subject: [PATCH 06/21] Enable custom popups on weather card. --- .../actions/actions_card_overlay.yaml | 46 +++++++++++++++++++ .../card_templates/cards/card_weather.yaml | 2 + docs/setup/custom_actions.md | 11 +++++ 3 files changed, 59 insertions(+) create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml new file mode 100644 index 000000000..d2d3422e6 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml @@ -0,0 +1,46 @@ +--- +### Overlay to enable custom actions card over other cards ### +ulm_actions_card_overlay: + template: + - "ulm_custom_actions" + - "ulm_actions_card" + styles: + grid: + - position: relative + - z-index: 0 + custom_fields: + actions_card_overlay: + - position: absolute + - left: 0px + - top: 0px + - height: 100% + - width: 100% + - display: grid + - z-index: 10 + custom_fields: + actions_card_overlay: + card: + type: "custom:button-card" + template: + - "ulm_actions_card" + entity: "[[[ return (entity != null) ? entity.entity_id : null; ]]]" + show_icon: false + show_name: false + show_label: false + styles: + card: + - height: 100% + - background: none + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_card_tap_action: "[[[ return variables.ulm_card_tap_action; ]]]" + ulm_card_tap_haptic: "[[[ return variables.ulm_card_tap_haptic; ]]]" + ulm_card_tap_navigate_path: "[[[ return variables.ulm_card_tap_navigate_path; ]]]" + ulm_card_hold_action: "[[[ return variables.ulm_card_hold_action; ]]]" + ulm_card_hold_haptic: "[[[ return variables.ulm_card_hold_haptic; ]]]" + ulm_card_hold_navigate_path: "[[[ return variables.ulm_card_hold_navigate_path; ]]]" + ulm_card_double_tap_action: "[[[ return variables.ulm_card_double_tap_action; ]]]" + ulm_card_double_tap_haptic: "[[[ return variables.ulm_card_double_tap_haptic; ]]]" + ulm_card_double_tap_navigate_path: "[[[ return variables.ulm_card_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml index 79516df6a..9f51362e3 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml @@ -1,6 +1,8 @@ --- ### Card Weather ### card_weather: + template: + - "ulm_actions_card_overlay" variables: ulm_card_weather_backdrop: false ulm_card_weather_primary_info: "extrema" diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index e98ec84da..8c4416040 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -242,6 +242,17 @@ Most of the internal card templates uses this option. Take a look into the code. --8<-- "custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml" ``` +### Use template `ulm_actions_card_overlay` + +If you implement a custom card that is based on another Lovelace card like the +(weather card)[https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/] you can simply enable custom +card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and +reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card. +Actions of the underlying card will be disabled by this method. + +The (weather card)[https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/] gives you an example and +will show the usage of this method. + ### Individual implementation The following script shows the usage off all necessary variables and template that will be used by the custom actions. From fb41a66557e6eaac1148b4307967fd905c123afd Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 14 Aug 2022 11:35:14 +0200 Subject: [PATCH 07/21] Fix number of forecast entities. --- .../popups/popup_weather_forecast.yaml | 86 ++++++++++++------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index 58c6f2c5f..2906f05c7 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -92,37 +92,61 @@ popup_weather_forecast: temp: "[[[ return entity.attributes.temperature + '°' ]]]" tempminmax: "[[[ return 'Max. ' + entity.attributes.forecast[0].temperature + '° Min. ' + entity.attributes.forecast[0].templow + '°' ]]]" - type: "vertical-stack" - cards: - - type: "custom:button-card" - template: "popup_weather_row" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_weather_entity_idx: 0 - - type: "custom:button-card" - template: "popup_weather_row" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_weather_entity_idx: 1 - - type: "custom:button-card" - template: "popup_weather_row" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_weather_entity_idx: 2 - - type: "custom:button-card" - template: "popup_weather_row" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_weather_entity_idx: 3 - - type: "custom:button-card" - template: "popup_weather_row" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_weather_entity_idx: 4 - - type: "custom:button-card" - template: "popup_weather_row" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_weather_entity_idx: 5 + cards: > + [[[ + let rows = []; + + function generate_weather_row(index) { + var row = { + 'type': 'custom:button-card', + 'template': 'popup_weather_row', + 'entity': entity.entity_id, + 'variables': { + 'ulm_popup_weather_entity_idx': index + } + }; + return row; + } + + let index = 0; + for (let forecast in entity.attributes.forecast) { + rows.push(generate_weather_row(index)); + index++; + } + return rows; + ]]] + # Code above create following cards + # cards: + # - type: "custom:button-card" + # template: "popup_weather_row" + # entity: "[[[ return entity.entity_id ]]]" + # variables: + # ulm_popup_weather_entity_idx: 0 + # - type: "custom:button-card" + # template: "popup_weather_row" + # entity: "[[[ return entity.entity_id ]]]" + # variables: + # ulm_popup_weather_entity_idx: 1 + # - type: "custom:button-card" + # template: "popup_weather_row" + # entity: "[[[ return entity.entity_id ]]]" + # variables: + # ulm_popup_weather_entity_idx: 2 + # - type: "custom:button-card" + # template: "popup_weather_row" + # entity: "[[[ return entity.entity_id ]]]" + # variables: + # ulm_popup_weather_entity_idx: 3 + # - type: "custom:button-card" + # template: "popup_weather_row" + # entity: "[[[ return entity.entity_id ]]]" + # variables: + # ulm_popup_weather_entity_idx: 4 + # - type: "custom:button-card" + # template: "popup_weather_row" + # entity: "[[[ return entity.entity_id ]]]" + # variables: + # ulm_popup_weather_entity_idx: 5 buttons: card: type: "custom:button-card" From 4835278e55b7d85d4a2135cffd6eba1b74f2c072 Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 14 Aug 2022 16:38:18 +0200 Subject: [PATCH 08/21] Add max number of row entries. --- .../popup_templates/popups/popup_weather_forecast.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index 2906f05c7..ae89744fe 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -112,6 +112,9 @@ popup_weather_forecast: for (let forecast in entity.attributes.forecast) { rows.push(generate_weather_row(index)); index++; + if (index > 5) { + break; + } } return rows; ]]] From 360d4b01d796c912163964facea46b85fb9d4906 Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 14 Aug 2022 20:52:35 +0200 Subject: [PATCH 09/21] Add empty dict as default variable for popups. --- .../ulm_templates/actions/actions_card.yaml | 7 ++-- .../ulm_templates/actions/actions_icon.yaml | 3 ++ .../ulm_templates/actions/actions_name.yaml | 3 ++ docs/setup/custom_actions.md | 32 +++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index 082fb5236..73dd092da 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -91,6 +91,7 @@ ulm_actions_card: return popup_config.popup_variables; } } + return {}; ]]] hold_action: action: > @@ -121,7 +122,7 @@ ulm_actions_card: action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_card_hold_action == 'navigate' ? variables.ulm_card_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_hold_haptic != null ? variables.ulm_card_hold_haptic : 'none' ]]]" @@ -182,6 +183,7 @@ ulm_actions_card: return popup_config.popup_variables; } } + return {}; ]]] double_tap_action: action: > @@ -212,7 +214,7 @@ ulm_actions_card: action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_card_double_tap_action == 'navigate' ? variables.ulm_card_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_double_tap_haptic != null ? variables.ulm_card_double_tap_haptic : 'none' ]]]" @@ -273,4 +275,5 @@ ulm_actions_card: return popup_config.popup_variables; } } + return {}; ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index b0e7d63ef..c2e2af9f2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -101,6 +101,7 @@ ulm_actions_icon: return popup_config.popup_variables; } } + return {}; ]]] hold_action: action: > @@ -202,6 +203,7 @@ ulm_actions_icon: return popup_config.popup_variables; } } + return {}; ]]] double_tap_action: action: > @@ -297,4 +299,5 @@ ulm_actions_icon: return popup_config.popup_variables; } } + return {}; ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 1c34c77bb..3f8bd028b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -91,6 +91,7 @@ ulm_actions_name: return popup_config.popup_variables; } } + return {}; ]]] hold_action: action: > @@ -182,6 +183,7 @@ ulm_actions_name: return popup_config.popup_variables; } } + return {}; ]]] double_tap_action: action: > @@ -273,4 +275,5 @@ ulm_actions_name: return popup_config.popup_variables; } } + return {}; ]]] diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index e98ec84da..8d968a593 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -334,3 +334,35 @@ show_name: false show_label: false show_units: false ``` + +The usage of variables within the popup have some restrictions. Default variables of the popup don't work in the same +way as for other custom button cards. The default variables -- defined in the variables section -- will always be overwritten by +the custom actions caller. + +The following code won't work on custom popup cards: + +```yaml +popup_weather_forecast: +... + variables: + ulm_weather_popup_surpress_first_forecast: false +... +``` + +Instead of using the variables section of the card the variables must be checked within a JavaScript template. The following +code shows an example how to check and define a default value of custom popup variable: + +```yaml +element: > + [[[ + let surpress_first_forecast = ('ulm_weather_popup_surpress_first_forecast' in variables) ? variables.ulm_weather_popup_surpress_first_forecast : false; + + if (surpress_first_forecast) { + ... + } + + return surpress_first_forecast; + ]]] +``` + +The code checks if the variable is available before reading from the variabl and if the variable isn't available it will set a default value. \ No newline at end of file From 43555e82a4ca1127ea706a5a00d4efb4d090355d Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 14 Aug 2022 21:00:07 +0200 Subject: [PATCH 10/21] Surpress first forecast entry of weather popup. --- .../popups/popup_weather_forecast.yaml | 34 ++++++++++++------- docs/usage/popups/popup_weather.md | 10 +++++- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index ae89744fe..c9c5dcd5d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -97,24 +97,32 @@ popup_weather_forecast: let rows = []; function generate_weather_row(index) { - var row = { - 'type': 'custom:button-card', - 'template': 'popup_weather_row', - 'entity': entity.entity_id, - 'variables': { - 'ulm_popup_weather_entity_idx': index - } - }; - return row; + var row = { + 'type': 'custom:button-card', + 'template': 'popup_weather_row', + 'entity': entity.entity_id, + 'variables': { + 'ulm_popup_weather_entity_idx': index + } + }; + return row; } + + let surpress_first_forecast = ('ulm_weather_popup_surpress_first_forecast' in variables) ? variables.ulm_weather_popup_surpress_first_forecast : false; let index = 0; for (let forecast in entity.attributes.forecast) { - rows.push(generate_weather_row(index)); + + if ((index == 0) && surpress_first_forecast) { index++; - if (index > 5) { - break; - } + continue; + } + + rows.push(generate_weather_row(index)); + index++; + if (rows.length >= 6) { + break; + } } return rows; ]]] diff --git a/docs/usage/popups/popup_weather.md b/docs/usage/popups/popup_weather.md index 3538ab27d..784008acd 100644 --- a/docs/usage/popups/popup_weather.md +++ b/docs/usage/popups/popup_weather.md @@ -21,10 +21,18 @@ To enable this popup, add the following code to your card: ```yaml ulm_custom_popup: template: "popup_weather_forecast" + entity: weather.xxx popup_variables: - ulm_popup_weather_entity: weather.xxx + ulm_weather_popup_surpress_first_forecast: false ``` +## Variables + +| Variable | Default | Required | Notes | +|-------------------------------------------|---------|------------------|-------------------------------| +| entity | | :material-check: | | +| ulm_weather_popup_surpress_first_forecast | false | :material-close: | Surpress first forecast entry | + ## Credits - Designed by schumijo From 8bef6eb47bbc5637add7eaf9c64920ddcfe8c4c5 Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:57:05 +0200 Subject: [PATCH 11/21] Fix check quality --- docs/setup/custom_actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index 8d968a593..e48ba4d2e 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -365,4 +365,4 @@ element: > ]]] ``` -The code checks if the variable is available before reading from the variabl and if the variable isn't available it will set a default value. \ No newline at end of file +The code checks if the variable is available before reading from the variabl and if the variable isn't available it will set a default value. From 5df5b4be1fb056edb09c8c2e22ceac826f1abf90 Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:58:29 +0200 Subject: [PATCH 12/21] Fix popup error --- .../popup_templates/popups/popup_weather_forecast.yaml | 3 ++- .../popup_templates/popups/popup_weather_radar.yaml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index c9c5dcd5d..f228c8910 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -1,6 +1,7 @@ --- popup_weather_forecast: - show_icon: false + variables: + ulm_weather_popup_surpress_first_forecast: false show_icon: false show_name: false show_label: false show_units: false diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml index 701379617..c00306008 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -1,6 +1,8 @@ --- popup_weather_radar: template: "popup_weather_forecast" + variables: + ulm_weather_popup_surpress_first_forecast: false styles: grid: - grid-template-areas: "'header' 'content2' 'buttons' 'footer'" From 4af71ae28797a582015ff136c481a87834396a56 Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Thu, 18 Aug 2022 17:00:44 +0200 Subject: [PATCH 13/21] Small fix --- .../popup_templates/popups/popup_weather_forecast.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index f228c8910..96cce1499 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -1,7 +1,8 @@ --- popup_weather_forecast: variables: - ulm_weather_popup_surpress_first_forecast: false show_icon: false + ulm_weather_popup_surpress_first_forecast: false + show_icon: false show_name: false show_label: false show_units: false From 1d34fca81497eea54186f078feb99d4b5f1a8fc0 Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Thu, 18 Aug 2022 17:04:39 +0200 Subject: [PATCH 14/21] Fix quality --- .../popup_templates/popups/popup_weather_forecast.yaml | 2 +- docs/setup/custom_actions.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index 96cce1499..c7f5bc001 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -111,7 +111,7 @@ popup_weather_forecast: } let surpress_first_forecast = ('ulm_weather_popup_surpress_first_forecast' in variables) ? variables.ulm_weather_popup_surpress_first_forecast : false; - + let index = 0; for (let forecast in entity.attributes.forecast) { diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index e48ba4d2e..fabbeb8bb 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -356,11 +356,11 @@ code shows an example how to check and define a default value of custom popup va element: > [[[ let surpress_first_forecast = ('ulm_weather_popup_surpress_first_forecast' in variables) ? variables.ulm_weather_popup_surpress_first_forecast : false; - + if (surpress_first_forecast) { ... } - + return surpress_first_forecast; ]]] ``` From 82ff6abcea8214d9dd0c5b238751a893e3f6127c Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:12:27 +0200 Subject: [PATCH 15/21] Fix quality --- .../actions/actions_card_overlay.yaml | 18 +++++++++--------- docs/setup/custom_actions.md | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml index d2d3422e6..cd5e7cd42 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml @@ -6,16 +6,16 @@ ulm_actions_card_overlay: - "ulm_actions_card" styles: grid: - - position: relative + - position: "relative" - z-index: 0 custom_fields: actions_card_overlay: - - position: absolute - - left: 0px - - top: 0px - - height: 100% - - width: 100% - - display: grid + - position: "absolute" + - left: "0px" + - top: "0px" + - height: "100%" + - width: "100"% + - display: "grid" - z-index: 10 custom_fields: actions_card_overlay: @@ -29,8 +29,8 @@ ulm_actions_card_overlay: show_label: false styles: card: - - height: 100% - - background: none + - height: "100%" + - background: "none" variables: ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index 8c4416040..63d6423dd 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -245,12 +245,12 @@ Most of the internal card templates uses this option. Take a look into the code. ### Use template `ulm_actions_card_overlay` If you implement a custom card that is based on another Lovelace card like the -(weather card)[https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/] you can simply enable custom +[weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) you can simply enable custom card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card. Actions of the underlying card will be disabled by this method. -The (weather card)[https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/] gives you an example and +The [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) gives you an example and will show the usage of this method. ### Individual implementation From 5ba00eefb16a1a54c5e081e356d6fb6a068da300 Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:20:31 +0200 Subject: [PATCH 16/21] Fix quality --- .../ulm_templates/actions/actions_card_overlay.yaml | 2 +- docs/setup/custom_actions.md | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml index cd5e7cd42..592e665aa 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card_overlay.yaml @@ -14,7 +14,7 @@ ulm_actions_card_overlay: - left: "0px" - top: "0px" - height: "100%" - - width: "100"% + - width: "100%" - display: "grid" - z-index: 10 custom_fields: diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index 63d6423dd..0320325e0 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -244,14 +244,10 @@ Most of the internal card templates uses this option. Take a look into the code. ### Use template `ulm_actions_card_overlay` -If you implement a custom card that is based on another Lovelace card like the -[weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) you can simply enable custom -card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and -reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card. +If you implement a custom card that is based on another Lovelace card like the [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) you can simply enable custom card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card. Actions of the underlying card will be disabled by this method. -The [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) gives you an example and -will show the usage of this method. +The [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) gives you an example and will show the usage of this method. ### Individual implementation From 0a06e4780e70b9f37b136fffcac407c1a4c1fc8b Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:26:05 +0200 Subject: [PATCH 17/21] Fix quality --- docs/setup/custom_actions.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index 0320325e0..362e69a19 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -244,10 +244,14 @@ Most of the internal card templates uses this option. Take a look into the code. ### Use template `ulm_actions_card_overlay` -If you implement a custom card that is based on another Lovelace card like the [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) you can simply enable custom card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card. +If you implement a custom card that is based on another Lovelace card like the +[weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) you can simply enable custom +card actions by using the template `ulm_actions_card_overlay` on the card. This template adds an overlay over the whole card and +reaction on the tap, hold, double tap actions. It also enables the integration of custom popups for the card. Actions of the underlying card will be disabled by this method. -The [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) gives you an example and will show the usage of this method. +The [weather card](https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_weather/) gives you an example and +will show the usage of this method. ### Individual implementation From 15a5ae9433f81a7ac66d9c8917e438280493daa9 Mon Sep 17 00:00:00 2001 From: schumijo <40740060+schumijo@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:31:18 +0200 Subject: [PATCH 18/21] Fix quality --- docs/usage/popups/popup_weather.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/popups/popup_weather.md b/docs/usage/popups/popup_weather.md index 784008acd..195a96fd1 100644 --- a/docs/usage/popups/popup_weather.md +++ b/docs/usage/popups/popup_weather.md @@ -31,7 +31,7 @@ To enable this popup, add the following code to your card: | Variable | Default | Required | Notes | |-------------------------------------------|---------|------------------|-------------------------------| | entity | | :material-check: | | -| ulm_weather_popup_surpress_first_forecast | false | :material-close: | Surpress first forecast entry | +| ulm_weather_popup_surpress_first_forecast | false | :material-close: | Suppress first forecast entry | ## Credits From df0e8d73b9f91a72d7bdffbba705a124778fb1cf Mon Sep 17 00:00:00 2001 From: mitchoklemen <38099509+mitchoklemen@users.noreply.github.com> Date: Thu, 25 Aug 2022 11:05:34 +0200 Subject: [PATCH 19/21] Update and rename en.json to sl.json Slovenian translation (Slovenija) --- .../translations/en.json | 60 ------------------- .../translations/sl.json | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 custom_components/ui_lovelace_minimalist/translations/en.json create mode 100644 custom_components/ui_lovelace_minimalist/translations/sl.json diff --git a/custom_components/ui_lovelace_minimalist/translations/en.json b/custom_components/ui_lovelace_minimalist/translations/en.json deleted file mode 100644 index c0ce54f02..000000000 --- a/custom_components/ui_lovelace_minimalist/translations/en.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "title": "UI Lovelace Minimalist", - "config": { - "step": { - "user": { - "title": "UI Lovelace Minimalist Settings", - "description": "", - "data": { - "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require GitHub authentication!" - } - }, - "device": { - "title": "Waiting for device activation" - }, - "reauth_confirm": { - "title": "Reauthentication needed", - "description": "You need to reauthenticate with GitHub." - } - }, - "abort": { - "single_instance_allowed": "Only a single configuration of UI Lovelace Minimalist is allowed.", - "not_setup": "UI Lovelace Minimalist is not setup.", - "github": "Could not authenticate with GitHub, try again later.", - "reauth_successful": "Reauthentication was successful." - }, - "progress": { - "wait_for_device": "1. Open {url} \n2.Paste the following key to authorize ULM: \n```\n{code}\n```\n" - } - }, - "options": { - "step": { - "user": { - "title": "UI Lovelace Minimalist Settings", - "description": "", - "data": { - "language": "Language", - "sidepanel_enabled": "Enable creation of a Dashboard entry in the Side panel.", - "sidepanel_icon": "Side panel icon", - "sidepanel_title": "Side panel title", - "adaptive_ui_enabled": "Enable adaptive Dashboard with popup splitview", - "adaptive_ui_title": "adaptive panel title", - "adaptive_ui_icon": "adaptive panel icon", - "theme": "Theme", - "include_other_cards": "Include custom card resources it's depending on.", - "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require GitHub authentication!", - "community_cards": "Select Community Cards you want to enable." - } - } - }, - "abort": { - "single_instance_allowed": "Only a single configuration of UI Lovelace Minimalist is allowed.", - "not_setup": "UI Lovelace Minimalist is not setup." - }, - "error": { - "github_cards": "Something went wrong when fetching cards from GitHub.", - "ack": "You need to acknowledge all statements.", - "gh_token": "Github Token not set. Please re-install this integration to go through the setup procedure. (No custom configuration will be lost)" - } - } -} diff --git a/custom_components/ui_lovelace_minimalist/translations/sl.json b/custom_components/ui_lovelace_minimalist/translations/sl.json new file mode 100644 index 000000000..56a6e4fbd --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/translations/sl.json @@ -0,0 +1,60 @@ +{ + "title": "UI Lovelace Minimalist", + "config": { + "step": { + "user": { + "title": "UI Lovelace Minimalist nastavitve", + "description": "", + "data": { + "community_cards_enabled": "Omogočite možnost konfiguriranja skupnih kartic s to integracijo, zahteva preverjanje pristnosti GitHub!" + } + }, + "device": { + "title": "Čakanje na aktivacijo naprave" + }, + "reauth_confirm": { + "title": "Potrebno ponovno preverjanje pristnosti", + "description": "Ponovno morate opraviti avtentikacijo z GitHubom." + } + }, + "abort": { + "single_instance_allowed": "Dovoljena je samo ena konfiguracija uporabniškega vmesnika Lovelace Minimalist.", + "not_setup": "UI Lovelace Minimalist ni nastavljen.", + "github": "Ni bilo mogoče preveriti pristnosti z GitHub, poskusite znova pozneje.", + "reauth_successful": "Ponovna avtentikacija je bila uspešna." + }, + "progress": { + "wait_for_device": "1. Odpri {url} \n2.Za avtorizacijo prilepite naslednji ključ ULM: \n```\n{code}\n```\n" + } + }, + "options": { + "step": { + "user": { + "title": "UI Lovelace Minimalist nastavitve", + "description": "", + "data": { + "language": "Jezik", + "sidepanel_enabled": "Omogoči ustvarjanje vnosa nadzorne plošče na stranski plošči.", + "sidepanel_icon": "Ikona stranske plošče", + "sidepanel_title": "Naslov stranske plošče", + "adaptive_ui_enabled": "Omogoči prilagodljivo nadzorno ploščo s pojavnim razdeljenim pogledom", + "adaptive_ui_title": "naslov prilagodljive plošče", + "adaptive_ui_icon": "ikona prilagodljive plošče", + "theme": "Tema", + "include_other_cards": "Vključite vire kartice po meri, od katerih je odvisno.", + "community_cards_enabled": "Omogočite možnost konfiguriranja skupnih kartic s to integracijo, zahteva preverjanje pristnosti GitHub!", + "community_cards": "Izberite skupne kartice, ki jih želite omogočiti." + } + } + }, + "abort": { + "single_instance_allowed": "Dovoljena je samo ena konfiguracija uporabniškega vmesnika Lovelace Minimalist.", + "not_setup": "UI Lovelace Minimalist ni nastavljen." + }, + "error": { + "github_cards": "Pri pridobivanju kartic iz GitHub je šlo nekaj narobe.", + "ack": "Vse izjave morate potrditi.", + "gh_token": "Žeton Github ni nastavljen. Znova namestite to integracijo, da opravite postopek namestitve. (Nobena konfiguracija po meri ne bo izgubljena)" + } + } +} From 5b43a3de689f0dad8f6e77b39312b37ca8359463 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Wed, 31 Aug 2022 13:53:57 +0200 Subject: [PATCH 20/21] re-add en.json --- .../translations/en.json | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 custom_components/ui_lovelace_minimalist/translations/en.json diff --git a/custom_components/ui_lovelace_minimalist/translations/en.json b/custom_components/ui_lovelace_minimalist/translations/en.json new file mode 100644 index 000000000..c0ce54f02 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/translations/en.json @@ -0,0 +1,60 @@ +{ + "title": "UI Lovelace Minimalist", + "config": { + "step": { + "user": { + "title": "UI Lovelace Minimalist Settings", + "description": "", + "data": { + "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require GitHub authentication!" + } + }, + "device": { + "title": "Waiting for device activation" + }, + "reauth_confirm": { + "title": "Reauthentication needed", + "description": "You need to reauthenticate with GitHub." + } + }, + "abort": { + "single_instance_allowed": "Only a single configuration of UI Lovelace Minimalist is allowed.", + "not_setup": "UI Lovelace Minimalist is not setup.", + "github": "Could not authenticate with GitHub, try again later.", + "reauth_successful": "Reauthentication was successful." + }, + "progress": { + "wait_for_device": "1. Open {url} \n2.Paste the following key to authorize ULM: \n```\n{code}\n```\n" + } + }, + "options": { + "step": { + "user": { + "title": "UI Lovelace Minimalist Settings", + "description": "", + "data": { + "language": "Language", + "sidepanel_enabled": "Enable creation of a Dashboard entry in the Side panel.", + "sidepanel_icon": "Side panel icon", + "sidepanel_title": "Side panel title", + "adaptive_ui_enabled": "Enable adaptive Dashboard with popup splitview", + "adaptive_ui_title": "adaptive panel title", + "adaptive_ui_icon": "adaptive panel icon", + "theme": "Theme", + "include_other_cards": "Include custom card resources it's depending on.", + "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require GitHub authentication!", + "community_cards": "Select Community Cards you want to enable." + } + } + }, + "abort": { + "single_instance_allowed": "Only a single configuration of UI Lovelace Minimalist is allowed.", + "not_setup": "UI Lovelace Minimalist is not setup." + }, + "error": { + "github_cards": "Something went wrong when fetching cards from GitHub.", + "ack": "You need to acknowledge all statements.", + "gh_token": "Github Token not set. Please re-install this integration to go through the setup procedure. (No custom configuration will be lost)" + } + } +} From b8302a617b5bc550385a845defdea89a540859d7 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Wed, 31 Aug 2022 14:02:13 +0200 Subject: [PATCH 21/21] Add new language to config flow --- custom_components/ui_lovelace_minimalist/const.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/ui_lovelace_minimalist/const.py b/custom_components/ui_lovelace_minimalist/const.py index b3fbf9088..877660bfb 100644 --- a/custom_components/ui_lovelace_minimalist/const.py +++ b/custom_components/ui_lovelace_minimalist/const.py @@ -31,6 +31,7 @@ "Polish": "pl", "Portuguese": "pt", "Portuguese (Brazil)": "pt-BR", + "Slovenian": "sl", "Slovak": "sk", "Swedish": "sv", "Turkish": "tr", @@ -51,6 +52,7 @@ "Polish", "Portuguese", "Portuguese (Brazil)", + "Slovenian", "Slovak", "Swedish", "Turkish",