custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
384 stars 30 forks source link

Cannot use, e.slice is not a function #76

Closed johnuopini closed 9 months ago

johnuopini commented 9 months ago

Checklist:

Release with the issue: 1.0.0

Last working release (if known): None

Browser and Operating System: Chrome / Firefox / Any

Description of problem: I am not able to use this plugin, whatever i do i get e.slice() not a function error I have a yaml defined lovelace config, config is this:

---
button_card_templates: !include_dir_merge_named "../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/"

# Custom cards
decluttering_templates: !include templates/graphs.yaml

# Core container
title: "Home"
theme: "minimalist-desktop"
background: "var(--background-image)"
views: 
  - !include views/main.yaml

Graphs is:

# Mini sensor
sensor_mini:
  default:
    icon: mdi-fire
  card:
    #type: custom:mini-graph-card
    type: custom:button-card
    name: '[[name]]'
    icon: '[[icon]]'

Main is

---
type: "custom:grid-layout"
title: "Main"
icon: "mdi:home"
path: "0"
layout:
  # Tablet / PC
  grid-template-columns: "1fr 1fr 1fr 1fr 1fr 1fr"
  grid-template-areas: |
    "living_temp living_temp temp temp humidity humidity"
cards:
  - view_layout:
      grid-area: "living_temp"
    type: custom:decluttering-card
    template: sensor_mini
    variables:
      name: Living
      icon: 'mdi:sofa'
...

Javascript errors shown in the web inspector (if applicable):

card custom:decluttering-card TypeError: e.slice is not a function
    _config decluttering-card.js:190
    setConfig decluttering-card.js:190
    r create-element-base.ts:95
    h create-element-base.ts:109
    h create-element-base.ts:213
    c create-element-base.ts:170
    f create-card-element.ts:102
    value hui-view.ts:66
    _cards hui-view.ts:288
    value hui-view.ts:287
    value hui-view.ts:216
    value hui-view.ts:132
    performUpdate reactive-element.ts:1327
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    _$Eu reactive-element.ts:946
    b reactive-element.ts:931
    i hui-view.ts:45
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:963
    value hui-root.ts:681
    setTimeout handler*r/< render-status.ts:2
    r render-status.ts:2
    value hui-root.ts:681
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    j lit-html.ts:1883
    _$AI lit-html.ts:1825
    v lit-html.ts:1192
    g lit-html.ts:1540
    _$AI lit-html.ts:1384
    z lit-html.ts:2183
    update lit-element.ts:165
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    value ha-panel-lovelace.ts:408
    value ha-panel-lovelace.ts:302
    value ha-panel-lovelace.ts:228
    handleEvent lit-html.ts:2018
    r fire_event.ts:76
    value hui-root.ts:716
    handleEvent lit-html.ts:2018
    fireRequestSelected mwc-list-item-base.ts:247
    61092 mwc-list-item-base.ts:92
    updated observer.ts:49
    updated observer.ts:42
    _$AE reactive-element.ts:1378
    performUpdate reactive-element.ts:1343
    scheduleUpdate reactive-element.ts:1261
    _$Ej reactive-element.ts:1233
    requestUpdate reactive-element.ts:1208
    set reactive-element.ts:726
    setSelectedStateForElementIndex mwc-list-base.ts:440
    setSingleSelectionAtIndex_ mwc-list-foundation.ts:401
    setSelectedIndexOnAction_ mwc-list-foundation.ts:565
    handleSingleSelection mwc-list-foundation.ts:307
    onRequestSelected mwc-list-base.ts:331
    handleEvent lit-html.ts:2018
    fireRequestSelected mwc-list-item-base.ts:247
    onClick mwc-list-item-base.ts:225
    cb mwc-list-item-base.ts:117
create-element-base.ts:180:12

Additional information: Latest home assistant, docker version, extension installed via HACS

ildar170975 commented 9 months ago

Read the docs & just compare with your code.

johnuopini commented 9 months ago

Read the docs & just compare with your code.

I can't see any difference, is exactly the same, is there anything i cant see?

ildar170975 commented 9 months ago

image

vs

image

johnuopini commented 9 months ago

image

That doesn't make any difference the dictionary is started by the layout item

ildar170975 commented 9 months ago

Check once more - the variables must be a LIST.

johnuopini commented 9 months ago

Check once more - the variables must be a LIST.

OHHH that was it, you could have said that :) Thanks mate!!! Closing

ildar170975 commented 9 months ago

you could have said that :)

or I could have helped you to guess by yourself))