Extract scene button template

This commit is contained in:
2020-05-03 03:16:03 +03:00
parent 78345828ae
commit 1a80a6223f
2 changed files with 32 additions and 12 deletions
@@ -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