custom-cards / flex-table-card

Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept
GNU General Public License v3.0
208 stars 26 forks source link

Table empty #69

Closed WarC0zes closed 2 years ago

WarC0zes commented 2 years ago

Hello, after the last update, my table is empty and I can't downgrade. I read the documentation but I don't see what broke my code.

flex table

  - type: custom:flex-table-card
    clickable: false
    entities:
      include: sensor.*_ble
    sort_by: friendly_name
    columns:
      - data: friendly_name
        name: Appareil Bluetooth
        icon: mdi:bluetooth
        modify: x.replace(/Ble/,"")
      - data: mac
        name: MAC
        modify: (x+'').replace(/(.{2}(?!$))/g,"$1:")
        align: center
      - data: msg_received
        name: Received
        modify: 'isNaN(parseInt(x, 10)) ? "" : parseInt(x, 10)'
        align: center
      - data: state
        name: Last Seen
        align: right
        modify: >
          var dt = new Date(0,0,0,0,0,0,(Date.now()-Date.parse(x)));
          isFinite(dt) ? dt.toTimeString().split(" ")[0] : ""
    style: |
      ha-card {
        box-shadow: 0px 2px 4px 0px rgba(0,0,0,1);
      }

another card works perfectly

  - type: custom:flex-table-card
    max_rows: 5
    sort_by: b7_price+
    clickable: true
    entities:
      include: sensor.carburants*
    columns:
      - data: state
        icon: fas:gas-pump
        align: left
        name: ' CARBURANT'
      - name: Diesel
        data: b7_price
        align: center
      - data: b7_date
        name: Date maj
        align: center
    css:
      tbody tr:nth-child(1): 'color: #00ff00'
      tbody tr:nth-child(5): 'color: #f00020'
    style: |
      :host {
        --card-mod-icon-color: rgb(68, 115, 158);
        font-size: 12.9px;
      }
      ha-card {
        box-shadow: 0px 2px 4px 0px rgba(0,0,0,0);
      }

it looks like it doesn't want to consider entity format anymore.

      include: sensor.*_ble

Can you help me please.

Masterz69 commented 2 years ago

Today's update totally ruined all Flex-tables, working before.

Masterz69 commented 2 years ago
          - type: 'custom:flex-table-card'
            clickable: true
            entities:
              include:
                - binary_sensor.*_gateway

^^ f.e. show empty table.

daringer commented 2 years ago

oh noes :/ will look into it ...

garry0garry commented 2 years ago

Cards don't work after update.

daringer commented 2 years ago

I just pushed a new state, essentially reverting a cleanup step, which might be evil - but as of now I can't really reproduce it. Could need some more details, like how do the entity ids look like which are not matched...

daringer commented 2 years ago

did the tables that are not shown anymore contain empty/undefined/null cells ?

WarC0zes commented 2 years ago

no, as in the picture that I put. Nothing appears in the table. my entity name is: sensor.xxxxxxxxxx_ble

BTScroggs commented 2 years ago

I'm getting two errors appear in the logs: TypeError: item.slice is not a function TypeError: content.slice is not a function

daringer commented 2 years ago

I'm getting two errors appear in the logs: TypeError: item.slice is not a function TypeError: content.slice is not a function

that's a good hint, looks like I am being to greedy with catching untested errors :/ please retest, the repository is updated

BTScroggs commented 2 years ago

Working again with latest. Thank you very much

daringer commented 2 years ago

pfew :+1: ok ok, note taken: need a beta branch for testing... thanks for reaching out and reporting!

WarC0zes commented 2 years ago

Yes, works perfeclty. Thanks