I’ve tried searching this topic for it but perhaps I’m not finding the correct search terms. But is there any way to filter out records from a table? E.g. I have a flex-table-card showing the passing busses at a busstop:
This data is coming from an integration that provides ALL the passages as an array in the next_passages attribute like so:
The integration doesn’t allow filtering, it always shows all the passages, but is there a way to handle this in the flex-table-card?
This is my current config:
type: custom:flex-table-card
title: Wittekaproenenplein, Gent
entities:
include: sensor.brugsepoort_gent
columns:
- name: Line
data: next_passages
modify: >-
'<div class= "line-number" style="padding: 1px 1px 4px 1px; height:
16px; color: #' + x.line_number_colourFrontHex + '; background-color: #'
+ x.line_number_colourBackHex + '; border-color: #' +
x.line_number_colourBackBorderHex + '"> ' + x.line_number_public +
' </div>'
align: center
- name: Type
data: next_passages
modify: >-
' <ha-icon icon="mdi:' + x.line_transport_type.toLowerCase() +
'"></ha-icon>'
- name: Towards
data: next_passages
modify: x.final_destination
- name: Due in (min)
data: next_passages
modify: x.due_in_min
- name: RT/C
data: next_passages
modify: |-
if (x.cancelled)
'<ha-icon icon="mdi:cancel">'
else if (x.is_realtime)
'<ha-icon icon="mdi:signal-variant">'
else
''
align: center
card_mod:
style: |
.line-number{
display:block;
float:left;
min-width:2.75em;
text-align:center;
font-weight:700;
color:#fff;
border-radius:4px;
border:3px solid #000;
margin-left:0rem;
margin-right:0.75rem;
font-size:1rem;
line-height:1.5em;
}
Thanks in advance!