Skip to content

Commit ffdfd95

Browse files
committed
Support for dividers
1 parent 4cab9bc commit ffdfd95

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.devcontainer/ui-lovelace.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ resources:
55
type: module
66

77
decluttering_templates:
8-
my_first_template: # This is the name of a template
8+
my_first_template: # This is the name of a template
99
default:
1010
- icon: fire
1111
card:
12-
type: custom:button-card
13-
name: '[[name]]'
14-
icon: 'mdi:[[icon]]'
12+
type: button
13+
name: "[[name]]"
14+
icon: "mdi:[[icon]]"
1515
large_divider:
1616
default:
1717
- opacity: 0.25
@@ -21,12 +21,14 @@ decluttering_templates:
2121
background-color: var(--secondary-text-color)
2222
height: 1px
2323
margin: 15px auto
24-
opacity: '[[opacity]]'
24+
opacity: "[[opacity]]"
2525

2626
views:
2727
- cards:
2828
- type: custom:decluttering-card
2929
template: my_first_template
30+
variables:
31+
- name: This is a test
3032
- type: entities
3133
entities:
3234
- sun.sun

src/decluttering-card.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class DeclutteringCard extends LitElement {
6060
private async _createCard(config: LovelaceCardConfig): Promise<LovelaceCard> {
6161
let element: LovelaceCard;
6262
if (HELPERS) {
63-
element = (await HELPERS).createCardElement(config);
63+
if (config.type === 'divider') element = (await HELPERS).createRowElement(config);
64+
else element = (await HELPERS).createCardElement(config);
6465
// fireEvent(element, 'll-rebuild');
6566
} else {
6667
element = createThing(config);

0 commit comments

Comments
 (0)