From 26024fe403ec872da364ea1353ffedf49a38916f Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 15 May 2025 06:16:39 -0400 Subject: [PATCH] Add streamline card template for outdoor "floor" cards --- mobile_dashboard.yaml | 77 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/mobile_dashboard.yaml b/mobile_dashboard.yaml index e40ed6d..0428e49 100644 --- a/mobile_dashboard.yaml +++ b/mobile_dashboard.yaml @@ -142,6 +142,83 @@ streamline_templates: elements: sub_buttons: - 1 + main_button_outdoors: + defaults: + name: '' + icon: '' + navigation_path: '' + occupancy_entity: '' + temp_entity: '' + lux_entity: '' + card: + type: custom:bubble-card + card_type: button + button_type: state + entity: '[[occupancy_entity]]' + name: '[[name]]' + icon: '[[icon]]' + show_state: false + double_tap_action: + action: none + hold_action: + action: none + tap_action: + action: navigate + navigation_path: '[[navigation_path]]' + button_action: + double_tap_action: + action: none + hold_action: + action: none + tap_action: + action: navigate + navigation_path: '[[navigation_path]]' + styles_javascript: | + const occupancy = states['[[occupancy_entity]]'].state; + return ` + .is-unavailable { + opacity: 0.5 !important; + } + .bubble-button-background { + opacity: 1 !important; + background-color: ${ + occupancy === 'on' ? 'var(--accent-color)' : 'var(--bubble-main-background-color)' + } !important; + transition: background-color 1s !important; + } + .bubble-sub-button { + background: transparent + } + .bubble-sub-button-1 { + background-color: ${ + occupancy === 'on' ? 'var(--accent-color)' : 'var(--bubble-main-background-color)' + } !important; + } + `; + sub_button: + - entity: '[[temp_entity]]' + name: Temp + show_state: true + show_name: false + tap_action: + action: navigate + navigation_path: '[[navigation_path]]' + show_background: false + - entity: '[[lux_entity]]' + show_state: true + name: Lux + tap_action: + action: navigate + navigation_path: '[[navigation_path]]' + show_background: false + modules: + - default + - temperature_colouring + temperature_colouring: + temperature_sensor: '[[temp_entity]]' + elements: + sub_buttons: + - 1 floors_separator: defaults: - name: ''