Move some bubble card button theming to modules
This commit is contained in:
@ -25,17 +25,10 @@ streamline_templates:
|
|||||||
action: none
|
action: none
|
||||||
hold_action:
|
hold_action:
|
||||||
action: more-info
|
action: more-info
|
||||||
styles: |-
|
|
||||||
.is-unavailable {
|
|
||||||
opacity: 0.5 !important;
|
|
||||||
}
|
|
||||||
.bubble-button-background {
|
|
||||||
opacity: 1 !important;
|
|
||||||
background-color: ${state === 'on' ? 'var(--error-color)' : 'var(--bubble-main-background-color)'} !important;
|
|
||||||
transition: background-color 1s !important;
|
|
||||||
}
|
|
||||||
show_state: false
|
show_state: false
|
||||||
columns: '[[columns]]'
|
columns: '[[columns]]'
|
||||||
|
modules:
|
||||||
|
- main_button_state_red
|
||||||
main_button_name:
|
main_button_name:
|
||||||
default:
|
default:
|
||||||
- name: ''
|
- name: ''
|
||||||
@ -94,30 +87,6 @@ streamline_templates:
|
|||||||
tap_action:
|
tap_action:
|
||||||
action: navigate
|
action: navigate
|
||||||
navigation_path: '[[navigation_path]]'
|
navigation_path: '[[navigation_path]]'
|
||||||
styles_javascript: |
|
|
||||||
const occupancy = states['[[occupancy_entity]]'].state;
|
|
||||||
const hot = states['[[hot_entity]]'].state;
|
|
||||||
const cold = states['[[cold_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: ${
|
|
||||||
hot === 'on' ? 'var(--error-color)' : cold === 'on' ? 'var(--purple-color)' : occupancy === 'on' ? 'var(--accent-color)' : 'var(--bubble-main-background-color)'
|
|
||||||
} !important;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
sub_button:
|
sub_button:
|
||||||
- entity: '[[temp_entity]]'
|
- entity: '[[temp_entity]]'
|
||||||
name: Temp
|
name: Temp
|
||||||
@ -137,11 +106,16 @@ streamline_templates:
|
|||||||
modules:
|
modules:
|
||||||
- default
|
- default
|
||||||
- temperature_colouring
|
- temperature_colouring
|
||||||
|
- main_button_floors
|
||||||
temperature_colouring:
|
temperature_colouring:
|
||||||
temperature_sensor: '[[temp_entity]]'
|
temperature_sensor: '[[temp_entity]]'
|
||||||
elements:
|
elements:
|
||||||
sub_buttons:
|
sub_buttons:
|
||||||
- 1
|
- 1
|
||||||
|
main_button_floors:
|
||||||
|
occupancy_entity: '[[occupancy_entity]]'
|
||||||
|
hot_entity: '[[hot_entity]]'
|
||||||
|
cold_entity: '[[cold_entity]]'
|
||||||
main_button_outdoors:
|
main_button_outdoors:
|
||||||
defaults:
|
defaults:
|
||||||
name: ''
|
name: ''
|
||||||
@ -173,28 +147,6 @@ streamline_templates:
|
|||||||
tap_action:
|
tap_action:
|
||||||
action: navigate
|
action: navigate
|
||||||
navigation_path: '[[navigation_path]]'
|
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:
|
sub_button:
|
||||||
- entity: '[[temp_entity]]'
|
- entity: '[[temp_entity]]'
|
||||||
name: Temp
|
name: Temp
|
||||||
@ -214,11 +166,14 @@ streamline_templates:
|
|||||||
modules:
|
modules:
|
||||||
- default
|
- default
|
||||||
- temperature_colouring
|
- temperature_colouring
|
||||||
|
- main_button_outdoors
|
||||||
temperature_colouring:
|
temperature_colouring:
|
||||||
temperature_sensor: '[[temp_entity]]'
|
temperature_sensor: '[[temp_entity]]'
|
||||||
elements:
|
elements:
|
||||||
sub_buttons:
|
sub_buttons:
|
||||||
- 1
|
- 1
|
||||||
|
main_button_outdoors:
|
||||||
|
occupancy_entity: '[[occupancy_entity]]'
|
||||||
floors_separator:
|
floors_separator:
|
||||||
defaults:
|
defaults:
|
||||||
- name: ''
|
- name: ''
|
||||||
|
Reference in New Issue
Block a user