mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-15 17:12:59 +00:00
Extract scene button template
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
scene:
|
||||
variables:
|
||||
scene_color_1:
|
||||
scene_color_2:
|
||||
degrees: 315
|
||||
tap_action:
|
||||
action: toggle
|
||||
styles:
|
||||
card:
|
||||
- background: >
|
||||
[[[
|
||||
const color_1 = variables.scene_color_1;
|
||||
const color_2 = variables.scene_color_2 || variables.scene_color_1;
|
||||
const degrees = variables.degrees;
|
||||
|
||||
return "linear-gradient("
|
||||
+ degrees + "deg, "
|
||||
+ color_1 + " 7%, "
|
||||
+ color_2 + " 7%, "
|
||||
+ color_2 + " 11%, var(--paper-card-background-color) 11%)"
|
||||
]]]
|
||||
@@ -87,23 +87,22 @@
|
||||
title: Scenes
|
||||
cards:
|
||||
- type: custom:button-card
|
||||
template: default
|
||||
template:
|
||||
- default
|
||||
- scene
|
||||
entity: script.scene_bedroom_neon
|
||||
name: Neon
|
||||
tap_action:
|
||||
action: toggle
|
||||
styles:
|
||||
card:
|
||||
- background: "linear-gradient(315deg, rgb(255, 0, 190) 7%, rgb(0, 255, 190) 7%, rgb(0, 255, 190) 11%, var(--paper-card-background-color) 11%)"
|
||||
variables:
|
||||
scene_color_1: rgb(255, 0, 190)
|
||||
scene_color_2: rgb(0, 255, 190)
|
||||
- type: custom:button-card
|
||||
template: default
|
||||
template:
|
||||
- default
|
||||
- scene
|
||||
entity: script.scene_bedroom_regular
|
||||
name: Regular
|
||||
tap_action:
|
||||
action: toggle
|
||||
styles:
|
||||
card:
|
||||
- background: "linear-gradient(315deg, rgb(254, 255, 209) 11%, var(--paper-card-background-color) 11%)"
|
||||
variables:
|
||||
scene_color_1: rgb(254, 255, 209)
|
||||
|
||||
- type: horizontal-stack
|
||||
title: Sensors
|
||||
|
||||
Reference in New Issue
Block a user