Skip to content

Commit

Permalink
Support for dividers
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Mar 22, 2020
1 parent 4cab9bc commit ffdfd95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .devcontainer/ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ resources:
type: module

decluttering_templates:
my_first_template: # This is the name of a template
my_first_template: # This is the name of a template
default:
- icon: fire
card:
type: custom:button-card
name: '[[name]]'
icon: 'mdi:[[icon]]'
type: button
name: "[[name]]"
icon: "mdi:[[icon]]"
large_divider:
default:
- opacity: 0.25
Expand All @@ -21,12 +21,14 @@ decluttering_templates:
background-color: var(--secondary-text-color)
height: 1px
margin: 15px auto
opacity: '[[opacity]]'
opacity: "[[opacity]]"

views:
- cards:
- type: custom:decluttering-card
template: my_first_template
variables:
- name: This is a test
- type: entities
entities:
- sun.sun
Expand Down
3 changes: 2 additions & 1 deletion src/decluttering-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class DeclutteringCard extends LitElement {
private async _createCard(config: LovelaceCardConfig): Promise<LovelaceCard> {
let element: LovelaceCard;
if (HELPERS) {
element = (await HELPERS).createCardElement(config);
if (config.type === 'divider') element = (await HELPERS).createRowElement(config);
else element = (await HELPERS).createCardElement(config);
// fireEvent(element, 'll-rebuild');
} else {
element = createThing(config);
Expand Down

0 comments on commit ffdfd95

Please sign in to comment.