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
|
title: Scenes
|
||||||
cards:
|
cards:
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: default
|
template:
|
||||||
|
- default
|
||||||
|
- scene
|
||||||
entity: script.scene_bedroom_neon
|
entity: script.scene_bedroom_neon
|
||||||
name: Neon
|
name: Neon
|
||||||
tap_action:
|
variables:
|
||||||
action: toggle
|
scene_color_1: rgb(255, 0, 190)
|
||||||
styles:
|
scene_color_2: rgb(0, 255, 190)
|
||||||
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%)"
|
|
||||||
- type: custom:button-card
|
- type: custom:button-card
|
||||||
template: default
|
template:
|
||||||
|
- default
|
||||||
|
- scene
|
||||||
entity: script.scene_bedroom_regular
|
entity: script.scene_bedroom_regular
|
||||||
name: Regular
|
name: Regular
|
||||||
tap_action:
|
variables:
|
||||||
action: toggle
|
scene_color_1: rgb(254, 255, 209)
|
||||||
styles:
|
|
||||||
card:
|
|
||||||
- background: "linear-gradient(315deg, rgb(254, 255, 209) 11%, var(--paper-card-background-color) 11%)"
|
|
||||||
|
|
||||||
- type: horizontal-stack
|
- type: horizontal-stack
|
||||||
title: Sensors
|
title: Sensors
|
||||||
|
|||||||
Reference in New Issue
Block a user