diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 9b15671b0..f5fdb518f 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -45,14 +45,14 @@ cd /tmp # Install dependency modules ## Browser mod echo "Installing Custom Component: Browser Mod" -wget https://github.com/thomasloven/hass-browser_mod/archive/refs/tags/1.5.1.tar.gz -O browser_mod.tar.gz +wget https://github.com/thomasloven/hass-browser_mod/archive/refs/tags/2.1.0.tar.gz -O browser_mod.tar.gz tar -xvf browser_mod.tar.gz rm -rf /config/custom_components/browser_mod mv hass-browser_mod*/custom_components/browser_mod /config/custom_components/browser_mod ## virtual echo "Installing Custom Component: Virtual" -wget https://github.com/twrecked/hass-virtual/archive/refs/tags/v0.7.5.tar.gz -O virtual.tar.gz +wget https://github.com/twrecked/hass-virtual/archive/refs/tags/v0.7.7.tar.gz -O virtual.tar.gz tar -xvf virtual.tar.gz rm -rf /config/custom_components/virtual mv hass-virtual*/custom_components/virtual /config/custom_components/virtual diff --git a/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml b/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml index 6120c1e03..c7a210937 100644 --- a/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml +++ b/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml @@ -111,104 +111,105 @@ custom_popup_imswel_person: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - title: "[[[ return states[variables.ulm_card_imswel_person_entity].attributes.friendly_name ]]]" - style: - $: > - [[[ - if (hass.themes.theme.includes("desktop")){ - var dialog = ` - .mdc-dialog__surface{ - border-radius: var(--border-radius) !important; + service: "browser_mod.popup" + data: + title: "[[[ return states[variables.ulm_card_imswel_person_entity].attributes.friendly_name ]]]" + style: + $: > + [[[ + if (hass.themes.theme.includes("desktop")){ + var dialog = ` + .mdc-dialog__surface{ + border-radius: var(--border-radius) !important; + } + `; + } else{ + var dialog = ""; + } + return ` + *{ + --secondary-background-color: none !important; } + ${dialog} `; - } else{ - var dialog = ""; - } - return ` - *{ - --secondary-background-color: none !important; - } - ${dialog} - `; - ]]] - hui-vertical-stack-card: - $: > - button-card { - align-self: center; - padding: 0.2em 0 2.3em 0; - } - hui-entities-card{ - padding: 0.8em 1.4em; - } - $hui-entities-card$: > - ha-card{ - box-shadow: none; - } - $hui-history-graph-card$: > - .content { - padding: 0 2.4em !important; - } - ha-card{ - box-shadow: none; - } - $hui-glance-card$: > - ha-card{ - box-shadow: none; - } - $hui-map-card: + ]]] + hui-vertical-stack-card: $: > - ha-icon-button { - color: rgba(var(--color-blue),1); + button-card { + align-self: center; + padding: 0.2em 0 2.3em 0; + } + hui-entities-card{ + padding: 0.8em 1.4em; + } + $hui-entities-card$: > + ha-card{ + box-shadow: none; + } + $hui-history-graph-card$: > + .content { + padding: 0 2.4em !important; } - $ha-map: + ha-card{ + box-shadow: none; + } + $hui-glance-card$: > + ha-card{ + box-shadow: none; + } + $hui-map-card: $: > - .leaflet-control-attribution { - display: none; - } - .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { - border: 2px solid rgba(var(--color-blue),0.4) !important; + ha-icon-button { + color: rgba(var(--color-blue),1); } - .leaflet-bar a { - background-color: rgba(var(--color-blue),0.2) !important; - color: rgba(var(--color-blue),1) !important; - } - .leaflet-bar a:first-child { - border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; - } - .leaflet-pane.leaflet-tile-pane { - filter: contrast(95%); - } - card: - type: "vertical-stack" - cards: - - type: "entities" - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" - secondary_info: "last-changed" - - type: "history-graph" - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" - - type: "glance" - show_state: false - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_wifi_tracker; ]]]" - name: "WiFi" - icon: "mdi:wifi" - style: &state > - state-badge{ - color: {{ 'rgba(var(--color-blue),1)' if is_state(config.entity, 'home') }}; - filter: {{ 'opacity(100%)' if is_state(config.entity, 'home') else 'opacity(40%)'}}; + $ha-map: + $: > + .leaflet-control-attribution { + display: none; + } + .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { + border: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-bar a { + background-color: rgba(var(--color-blue),0.2) !important; + color: rgba(var(--color-blue),1) !important; + } + .leaflet-bar a:first-child { + border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-pane.leaflet-tile-pane { + filter: contrast(95%); } - - entity: "[[[ return variables.ulm_card_imswel_person_gps_tracker; ]]]" - name: "GPS" - icon: "mdi:map-marker" - style: *state - - type: "custom:button-card" - template: - - "find_my_phone_button" - entity: "[[[ return variables.ulm_card_imswel_person_findmy_script; ]]]" - - type: "map" - aspect_ratio: "12x10" - default_zoom: 16 - entities: "[[[ return [variables.ulm_card_imswel_person_gps_tracker]; ]]]" + content: + type: "vertical-stack" + cards: + - type: "entities" + entities: + - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" + secondary_info: "last-changed" + - type: "history-graph" + entities: + - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" + - type: "glance" + show_state: false + entities: + - entity: "[[[ return variables.ulm_card_imswel_person_wifi_tracker; ]]]" + name: "WiFi" + icon: "mdi:wifi" + style: &state > + state-badge{ + color: {{ 'rgba(var(--color-blue),1)' if is_state(config.entity, 'home') }}; + filter: {{ 'opacity(100%)' if is_state(config.entity, 'home') else 'opacity(40%)'}}; + } + - entity: "[[[ return variables.ulm_card_imswel_person_gps_tracker; ]]]" + name: "GPS" + icon: "mdi:map-marker" + style: *state + - type: "custom:button-card" + template: + - "find_my_phone_button" + entity: "[[[ return variables.ulm_card_imswel_person_findmy_script; ]]]" + - type: "map" + aspect_ratio: "12x10" + default_zoom: 16 + entities: "[[[ return [variables.ulm_card_imswel_person_gps_tracker]; ]]]" diff --git a/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml b/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml index a8b0f5592..e546e2431 100644 --- a/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml +++ b/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml @@ -107,79 +107,80 @@ ulm_custom_card_schumijo_ca_popup: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - title: "Map" - style: - $: > - [[[ - if (hass.themes.theme.includes("desktop")){ - var dialog = ` - .mdc-dialog__surface{ - border-radius: var(--border-radius) !important; + service: "browser_mod.popup" + data: + title: "Map" + style: + $: > + [[[ + if (hass.themes.theme.includes("desktop")){ + var dialog = ` + .mdc-dialog__surface{ + border-radius: var(--border-radius) !important; + } + `; + } else{ + var dialog = ""; + } + return ` + *{ + --secondary-background-color: none !important; } + ${dialog} `; - } else{ - var dialog = ""; - } - return ` - *{ - --secondary-background-color: none !important; - } - ${dialog} - `; - ]]] - hui-vertical-stack-card: - $: > - button-card { - align-self: center; - padding: 0.2em 0 2.3em 0; - } - hui-entities-card{ - padding: 0.8em 1.4em; - } - $hui-entities-card$: > - ha-card{ - box-shadow: none; - } - $hui-history-graph-card$: > - .content { - padding: 0 2.4em !important; - } - ha-card{ - box-shadow: none; - } - $hui-glance-card$: > - ha-card{ - box-shadow: none; - } - $hui-map-card: + ]]] + hui-vertical-stack-card: $: > - ha-icon-button { - color: rgba(var(--color-blue),1); + button-card { + align-self: center; + padding: 0.2em 0 2.3em 0; + } + hui-entities-card{ + padding: 0.8em 1.4em; + } + $hui-entities-card$: > + ha-card{ + box-shadow: none; } - $ha-map: + $hui-history-graph-card$: > + .content { + padding: 0 2.4em !important; + } + ha-card{ + box-shadow: none; + } + $hui-glance-card$: > + ha-card{ + box-shadow: none; + } + $hui-map-card: $: > - .leaflet-control-attribution { - display: none; - } - .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { - border: 2px solid rgba(var(--color-blue),0.4) !important; + ha-icon-button { + color: rgba(var(--color-blue),1); } - .leaflet-bar a { - background-color: rgba(var(--color-blue),0.2) !important; - color: rgba(var(--color-blue),1) !important; - } - .leaflet-bar a:first-child { - border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; - } - .leaflet-pane.leaflet-tile-pane { - filter: contrast(95%); - } - card: - type: "map" - aspect_ratio: "12:10" - default_zoom: 16 - entities: "[[[ return [variables.ulm_card_schumijo_car_tracker]; ]]]" + $ha-map: + $: > + .leaflet-control-attribution { + display: none; + } + .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { + border: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-bar a { + background-color: rgba(var(--color-blue),0.2) !important; + color: rgba(var(--color-blue),1) !important; + } + .leaflet-bar a:first-child { + border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-pane.leaflet-tile-pane { + filter: contrast(95%); + } + content: + type: "map" + aspect_ratio: "12:10" + default_zoom: 16 + entities: "[[[ return [variables.ulm_card_schumijo_car_tracker]; ]]]" custom_card_schumijo_car: template: @@ -225,7 +226,8 @@ custom_card_schumijo_car: [[[ return parseFloat(states[variables.ulm_card_schumijo_car_energy_level].state).toFixed(0); ]]] - name: "[[[ return states[variables.ulm_card_schumijo_car_energy_level].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_energy_level\ + name: + "[[[ return states[variables.ulm_card_schumijo_car_energy_level].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_energy_level\ \ ]]]" item2: card: @@ -236,5 +238,6 @@ custom_card_schumijo_car: [[[ return parseFloat(states[variables.ulm_card_schumijo_car_range].state).toFixed(0); ]]] - name: "[[[ return states[variables.ulm_card_schumijo_car_range].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_range\ + name: + "[[[ return states[variables.ulm_card_schumijo_car_range].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_range\ \ ]]]" 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 3d5902ee4..25296463f 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 @@ -35,77 +35,70 @@ 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: > - [[[ - var action = variables.ulm_card_tap_action; + [[[ + var action = variables.ulm_card_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_card_tap_service; - ]]] + return variables.ulm_card_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_card_tap_action; + [[[ + var action = variables.ulm_card_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_tap_service_data; - ]]] + return variables.ulm_card_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] hold_action: action: > [[[ @@ -140,77 +133,70 @@ 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: > - [[[ - var action = variables.ulm_card_hold_action; + [[[ + var action = variables.ulm_card_hold_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_card_hold_service; - ]]] + return variables.ulm_card_hold_service; + ]]] service_data: > - [[[ - var action = variables.ulm_card_hold_action; + [[[ + var action = variables.ulm_card_hold_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_hold_service_data; - ]]] + return variables.ulm_card_hold_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] double_tap_action: action: > [[[ @@ -245,74 +231,67 @@ 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: > - [[[ - var action = variables.ulm_card_double_tap_action; + [[[ + var action = variables.ulm_card_double_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_card_double_tap_service; - ]]] + return variables.ulm_card_double_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_card_double_tap_action; + [[[ + var action = variables.ulm_card_double_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_double_tap_service_data; - ]]] + return variables.ulm_card_double_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + 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 e130f224a..9bc2e7802 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 @@ -35,94 +35,69 @@ 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: > - [[[ - var action = variables.ulm_icon_tap_action; + [[[ + var action = variables.ulm_icon_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_icon_tap_service; - ]]] + return variables.ulm_icon_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_icon_tap_action; + [[[ + var action = variables.ulm_icon_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_icon_tap_service_data; - ]]] + return variables.ulm_icon_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' - } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' - } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' - } - - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] hold_action: action: > [[[ @@ -157,94 +132,70 @@ 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: > - [[[ - var action = variables.ulm_icon_hold_action; + [[[ + var action = variables.ulm_icon_hold_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_icon_hold_service; - ]]] + return variables.ulm_icon_hold_service; + ]]] service_data: > - [[[ - var action = variables.ulm_icon_hold_action; + [[[ + var action = variables.ulm_icon_hold_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_icon_hold_service_data; - ]]] + return variables.ulm_icon_hold_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' - } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' - } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' - } - - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] double_tap_action: action: > [[[ @@ -283,81 +234,67 @@ 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: > - [[[ - var action = variables.ulm_icon_double_tap_action; + [[[ + var action = variables.ulm_icon_double_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_icon_double_tap_service; - ]]] + return variables.ulm_icon_double_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_icon_double_tap_action; + [[[ + var action = variables.ulm_icon_double_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_icon_double_tap_service_data; - ]]] + return variables.ulm_icon_double_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + 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 637a0c304..826cf5891 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 @@ -35,84 +35,70 @@ 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: > - [[[ - var action = variables.ulm_name_tap_action; + [[[ + var action = variables.ulm_name_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_name_tap_service; - ]]] + return variables.ulm_name_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_name_tap_action; + [[[ + var action = variables.ulm_name_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_name_tap_service_data; - ]]] + return variables.ulm_name_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] hold_action: action: > [[[ @@ -147,84 +133,70 @@ 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: > - [[[ - var action = variables.ulm_name_hold_action; + [[[ + var action = variables.ulm_name_hold_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_name_hold_service; - ]]] + return variables.ulm_name_hold_service; + ]]] service_data: > - [[[ - var action = variables.ulm_name_hold_action; + [[[ + var action = variables.ulm_name_hold_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_name_service_data; - ]]] + return variables.ulm_card_name_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] double_tap_action: action: > [[[ @@ -259,81 +231,67 @@ 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: > - [[[ - var action = variables.ulm_name_double_tap_action; + [[[ + var action = variables.ulm_name_double_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_name_double_tap_service; - ]]] + return variables.ulm_name_double_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_name_double_tap_action; + [[[ + var action = variables.ulm_name_double_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_name_double_tap_service_data; - ]]] + return variables.ulm_name_double_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] 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 a4e1ba541..df1f61aad 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 @@ -24,6 +24,22 @@ card_battery: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] icon: | [[[ // Get battery level @@ -96,6 +112,22 @@ card_battery: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_battery_name ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] label: | [[[ const battery_level = variables.ulm_card_battery_attribute !== null 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 b6501a4db..ed8f0dc4e 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 @@ -24,6 +24,22 @@ card_binary_sensor: - "blue" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_binary_sensor_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -33,3 +49,19 @@ card_binary_sensor: name: "[[[ return variables.ulm_card_binary_sensor_name; ]]]" label: "[[[ return variables.ulm_translation_state;]]]" show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] 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 2ca7fd9af..b70f63c10 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 @@ -24,6 +24,22 @@ card_binary_sensor_alert: - "blue" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_binary_sensor_alert_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -33,3 +49,19 @@ card_binary_sensor_alert: name: "[[[ return variables.ulm_card_binary_sensor_alert_name; ]]]" label: "[[[ return variables.ulm_translation_state;]]]" show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] 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 bc239d3a3..e8c9c1626 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 @@ -17,6 +17,22 @@ card_generic: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_generic_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] styles: icon: - color: "rgba(var(--color-theme),0.9)" @@ -26,3 +42,19 @@ card_generic: entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_translation_state_unit ]]]" label: "[[[ return variables.ulm_card_generic_name ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] 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 0b75b093c..ec7e4511a 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 @@ -20,9 +20,41 @@ card_generic_swap: styles: icon: - color: "rgba(var(--color-theme),0.9)" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" label: "[[[ return variables.ulm_translation_state_unit ]]]" name: "[[[ return variables.ulm_card_generic_swap_name ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] 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 cfaef7581..703ec4282 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 @@ -20,9 +20,24 @@ card_input_boolean: type: "custom:button-card" template: - "blue" - entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_input_boolean_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -31,3 +46,19 @@ card_input_boolean: entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_input_boolean_name; ]]]" label: "[[[ return variables.ulm_translation_state ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] 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 c0a952ff9..561d7f8ed 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 @@ -244,13 +244,14 @@ card_media_player: return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info"; ]]] browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id ]]]" tap_action: action: "call-service" service: "media_player.media_previous_track" @@ -283,13 +284,14 @@ card_media_player: return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info"; ]]] browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" tap_action: action: "call-service" service: "media_player.media_play_pause" @@ -328,13 +330,14 @@ card_media_player: return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info"; ]]] browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" tap_action: action: "call-service" service: "media_player.media_next_track" 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 70be47682..8d213d179 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 @@ -24,6 +24,20 @@ card_power_outlet: - "yellow" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_power_outlet_icon ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': {'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor} + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -39,3 +53,17 @@ card_power_outlet: return variables.ulm_translation_state; } ]]] + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': {'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor} + }; + } + return vars; + ]]] 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 a9e55191e..f1f79689b 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 @@ -16,6 +16,7 @@ card_thermostat: ulm_card_thermostat_enable_popup: false ulm_card_thermostat_fan_entity: null ulm_card_thermostat_minimum_temp_spread: 1 + ulm_card_thermostat_preset_mode: false show_icon: false show_name: false show_label: false @@ -153,7 +154,8 @@ card_thermostat: if(variables.ulm_card_thermostat_enable_popup) { vars.ulm_custom_popup = { - 'template': 'popup_thermostat_temperature' + 'template': 'popup_thermostat_temperature', + 'popup_variables': {'ulm_card_thermostat_preset_mode': variables.ulm_card_thermostat_preset_mode } }; } return vars; @@ -190,7 +192,8 @@ card_thermostat: if(variables.ulm_card_thermostat_enable_popup) { vars.ulm_custom_popup = { - 'template': 'popup_thermostat_temperature' + 'template': 'popup_thermostat_temperature', + 'popup_variables': {'ulm_card_thermostat_preset_mode': variables.ulm_card_thermostat_preset_mode } }; } return vars; diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml index e0638b80d..3e7759903 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml @@ -13,6 +13,7 @@ popup_button: - box-shadow: "none" - border-radius: "none" - padding: "12px" + - overflow: "visible" icon: - color: "var(--primary-color)" img_cell: @@ -27,3 +28,4 @@ popup_button: - font-weight: "bold" - font-size: "14px" - margin-top: "12px" + - overflow: "visible" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml index dd3ac5aef..84e58ab6f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml @@ -16,4 +16,5 @@ popup_button_back: tap_action: action: "fire-dom-event" browser_mod: - command: "close_popup" + service: "browser_mod.close_popup" + data: {} diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml index 2b70809ac..0d6483c17 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml @@ -3,10 +3,11 @@ popup_light: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_light_brightness" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_light_brightness" + entity: "[[[ return entity.entity_id; ]]]" 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 189f35b60..c80e94cca 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 @@ -219,6 +219,7 @@ popup_light_brightness: styles: card: - background: "none" + - overflow: "visible" grid: - grid-template-areas: > [[[ @@ -284,25 +285,18 @@ popup_light_brightness: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color_temp" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_light_color_temp" + entity: "[[[ return entity.entity_id; ]]]" item3: card: icon: "mdi:palette" @@ -323,25 +317,18 @@ popup_light_brightness: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_light_color" + entity: "[[[ return entity.entity_id; ]]]" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index e2faa4410..3a539bd11 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -50,25 +50,18 @@ popup_light_color: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_brightness" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_light_brightness" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:sun-thermometer-outline" @@ -79,25 +72,18 @@ popup_light_color: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color_temp" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_light_color_temp" + entity: "[[[ return entity.entity_id; ]]]" item3: card: icon: "mdi:palette" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index f7d7e705b..009a9ddf2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -50,25 +50,18 @@ popup_light_color_temp: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_brightness" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_light_brightness" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:sun-thermometer-outline" @@ -87,22 +80,15 @@ popup_light_color_temp: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_light_color" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml index fa6fd06ee..6a17e12ca 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml @@ -3,10 +3,11 @@ popup_media_player: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index 8d0a307c0..3fbeae037 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -223,25 +223,18 @@ popup_media_player_infos: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_media_player_volume" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_media_player_volume" + entity: "[[[ return entity.entity_id; ]]]" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 72d2b296c..bbfa60ebc 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -27,6 +27,26 @@ popup_media_player_volume: display: none; } custom_fields: + footer: + card: + type: "custom:button-card" + template: "popup_list_items" + custom_fields: + item1: + card: + type: "custom:button-card" + template: "popup_button_back" + tap_action: + action: "fire-dom-event" + browser_mod: + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" buttons: card: type: "custom:button-card" @@ -44,25 +64,18 @@ popup_media_player_volume: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" item2: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml index 095514343..ff2eb9eff 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml @@ -3,14 +3,15 @@ popup_power_outlet: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_power_outlet_stats" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" - ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" - ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_power_outlet_stats" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" + ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" + ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index e2f547607..efa39b2e6 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -45,29 +45,22 @@ popup_power_outlet_history: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_power_outlet_stats" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" - ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" - ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_power_outlet_stats" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" + ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" + ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" item2: card: icon: "mdi:history" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index b30180d93..0e204d2d5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -131,29 +131,22 @@ popup_power_outlet_stats: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_power_outlet_history" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" - ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" - ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_power_outlet_history" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" + ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" + ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml index 9735668a2..889fbf74f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml @@ -3,10 +3,11 @@ popup_thermostat: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_thermostat_temperature" - entity: "[[[ return entity.entity_id ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_thermostat_temperature" + entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml index ca5d7bbb4..9a1a81cc2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml @@ -63,51 +63,95 @@ popup_thermostat_temperature: buttons: card: type: "custom:button-card" + variables: + ulm_card_thermostat_preset_mode: "[[[ return variables.ulm_card_thermostat_preset_mode; ]]]" styles: grid: - grid-template-areas: > [[[ var areas = []; - if (entity.attributes.hvac_modes.includes("auto")) { - areas.push("auto"); - } - if (entity.attributes.hvac_modes.includes("heat")) { - areas.push("heat"); - } - if (entity.attributes.hvac_modes.includes("cool")) { - areas.push("cool"); - } - if (entity.attributes.hvac_modes.includes("dry")) { - areas.push("dry"); - } - if (entity.attributes.hvac_modes.includes("fan_only")) { - areas.push("fan_only"); - } - if (entity.attributes.hvac_modes.includes("heat_cool")) { - areas.push("heat_cool"); + if (variables.ulm_card_thermostat_preset_mode){ + if (entity.attributes.preset_modes.includes("none")) { + areas.push("none"); + } + if (entity.attributes.preset_modes.includes("away")) { + areas.push("away"); + } + if (entity.attributes.preset_modes.includes("comfort")) { + areas.push("comfort"); + } + if (entity.attributes.preset_modes.includes("home")) { + areas.push("home"); + } + if (entity.attributes.preset_modes.includes("sleep")) { + areas.push("sleep"); + } + if (entity.attributes.preset_modes.includes("activity")) { + areas.push("activity"); + } + } else { + if (entity.attributes.hvac_modes.includes("auto")) { + areas.push("auto"); + } + if (entity.attributes.hvac_modes.includes("heat")) { + areas.push("heat"); + } + if (entity.attributes.hvac_modes.includes("cool")) { + areas.push("cool"); + } + if (entity.attributes.hvac_modes.includes("dry")) { + areas.push("dry"); + } + if (entity.attributes.hvac_modes.includes("fan_only")) { + areas.push("fan_only"); + } + if (entity.attributes.hvac_modes.includes("heat_cool")) { + areas.push("heat_cool"); + } } return "\"" + areas.join(" ") + "\""; ]]] - grid-template-columns: > [[[ var columns = []; - if (entity.attributes.hvac_modes.includes("auto")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("heat")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("cool")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("dry")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("fan_only")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("heat_cool")) { - columns.push("1fr"); + if (variables.ulm_card_thermostat_preset_mode){ + if (entity.attributes.preset_modes.includes("none")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("away")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("comfort")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("home")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("sleep")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("activity")) { + columns.push("1fr"); + } + } else { + if (entity.attributes.hvac_modes.includes("auto")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("heat")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("cool")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("dry")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("fan_only")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("heat_cool")) { + columns.push("1fr"); + } } return columns.join(" "); ]]] @@ -122,7 +166,7 @@ popup_thermostat_temperature: auto: - display: > [[[ - if (entity.attributes.hvac_modes.includes("auto")) { + if (entity.attributes.hvac_modes.includes("auto") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -131,7 +175,7 @@ popup_thermostat_temperature: heat: - display: > [[[ - if (entity.attributes.hvac_modes.includes("heat")) { + if (entity.attributes.hvac_modes.includes("heat") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -140,7 +184,7 @@ popup_thermostat_temperature: cool: - display: > [[[ - if (entity.attributes.hvac_modes.includes("cool")) { + if (entity.attributes.hvac_modes.includes("cool") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -149,7 +193,7 @@ popup_thermostat_temperature: dry: - display: > [[[ - if (entity.attributes.hvac_modes.includes("dry")) { + if (entity.attributes.hvac_modes.includes("dry") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -158,7 +202,7 @@ popup_thermostat_temperature: fan_only: - display: > [[[ - if (entity.attributes.hvac_modes.includes("fan_only")) { + if (entity.attributes.hvac_modes.includes("fan_only") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -167,7 +211,61 @@ popup_thermostat_temperature: heat_cool: - display: > [[[ - if (entity.attributes.hvac_modes.includes("heat_cool")) { + if (entity.attributes.hvac_modes.includes("heat_cool") && !variables.ulm_card_thermostat_preset_mode) { + return "block"; + } else { + return "none"; + } + ]]] + none: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("none") && variables.ulm_card_thermostat_preset_mode) { + return "block"; + } else { + return "none"; + } + ]]] + away: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("away") && variables.ulm_card_thermostat_preset_mode) { + return "block"; + } else { + return "none"; + } + ]]] + comfort: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("comfort") && variables.ulm_card_thermostat_preset_mode) { + return "block"; + } else { + return "none"; + } + ]]] + home: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("home") && variables.ulm_card_thermostat_preset_mode) { + return "block"; + } else { + return "none"; + } + ]]] + sleep: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("sleep") && variables.ulm_card_thermostat_preset_mode) { + return "block"; + } else { + return "none"; + } + ]]] + activity: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("activity") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -330,6 +428,168 @@ popup_thermostat_temperature: - background-color: "var(--card-background-color)" - box-shadow: "var( --ha-card-box-shadow)" - transform: "scale(0.95)" + none: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:toggle-switch-off" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "none" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'none' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + away: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:home-switch-outline" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "away" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'away' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + comfort: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:car-seat-cooler" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "comfort" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'comfort' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + home: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:home" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "home" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'home' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + sleep: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:sleep" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "sleep" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'sleep' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + activity: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:ticket" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "activity" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'activity' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml index c225df1ba..ffb255004 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml @@ -3,10 +3,11 @@ popup_weather: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_weather_forecast" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_weather_forecast" + entity: "[[[ return entity.entity_id; ]]]" 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 fe2470867..1afcb0299 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 @@ -191,25 +191,18 @@ popup_weather_forecast: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_weather_radar" - entity: "[[[ return entity.entity_id ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_weather_radar" + entity: "[[[ return entity.entity_id ]]]" footer: card: type: "custom:button-card" 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 4844809f7..67bea3205 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 @@ -44,25 +44,18 @@ popup_weather_radar: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_weather_forecast" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: | + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; + content: + type: "custom:button-card" + template: "popup_weather_forecast" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:radar" diff --git a/docs/usage/popups/popup_power_outlet.md b/docs/usage/popups/popup_power_outlet.md index 3fdce0cb0..9e9aeeca9 100644 --- a/docs/usage/popups/popup_power_outlet.md +++ b/docs/usage/popups/popup_power_outlet.md @@ -16,12 +16,7 @@ hide: ##### Card compatibility -This popup is displayed using ``hold_action`` and it is compatible with the following cards/chips : - -!!! Warning "Warning" - - The popup is not compatible with the custom_actions! - The hold_action only works on the outer layer! +This popup is displayed using ``custom_actions`` and it is compatible with the following cards/chips : - card_generic - card_generic_swap @@ -62,7 +57,9 @@ This popup is displayed using ``hold_action`` and it is compatible with the foll ##### How to use -To enable this popup, you need to add the ``popup_power_outlet`` template on your card. And also the previously explained variables. +!!! warning "Breaking Change from version `V1.1.2`" + This popup can now be triggered with the custom action "popup". + The popup template can be deleted and use instead the variable `ulm_outlet_power_enable_popup: true` to enable the use of the popup. For example : @@ -70,14 +67,13 @@ For example : - type: "custom:button-card" template: - card_power_outlet - - popup_power_outlet variables: ulm_card_power_outlet_consumption_sensor: sensor.metered_wall_plug_switch_power_3 ulm_popup_power_outlet_sensor1: sensor.metered_wall_plug_switch_power_3 ulm_popup_power_outlet_sensor2: sensor.metered_wall_plug_switch_electric_consumed_kwh_2 ulm_popup_power_outlet_graph_sensor: sensor.metered_wall_plug_switch_power_3 + ulm_outlet_power_enable_popup: true entity: switch.metered_wall_plug_switch_2 - name: Prise téléphone ``` ## Credits diff --git a/docs/usage/popups/popup_thermostat.md b/docs/usage/popups/popup_thermostat.md index 72b8263d8..f7a2dec4e 100644 --- a/docs/usage/popups/popup_thermostat.md +++ b/docs/usage/popups/popup_thermostat.md @@ -15,6 +15,23 @@ This popup is displayed using ``hold_action`` and it is compatible with the foll - card_thermostat +##### Variables + + + + + + + + + + + + + + +
VariableExampleRequiredExplanation
ulm_card_thermostat_preset_modetruenoSwitch to Preset Mode
+ ##### How to use To enable this popup, add the variable ``ulm_card_thermostat_enable_popup`` and set to ``true``. @@ -30,6 +47,7 @@ For example : entity: climate.thermostat variables: ulm_card_thermostat_enable_popup: true + ulm_card_thermostat_preset_mode: true ``` ## Credits