Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:flex-table-card
- title: Pestre induló vonatok
- clickable: true
- entities:
- include:
- - sensor.mav_debrecen_bp_keleti
- - sensor.mav_debrecen_bp_nyugati_2
- sort: next_departures
- columns:
- - name: Indulás
- data: next_departures
- modify: |-
- if(x.length == 0)
- {"-"}
- else {
- var date = new Date(x);
- String(date.getHours()).padStart(2,'0')+":"+
- String(date.getMinutes()).padStart(2,'0')
- }
- - name: Célállomás
- data: next_departures_headsign
- modify: |-
- if (typeof x === 'string' && x.length > 0) {
- var match = x.match(/\(([^)]+)\)/);
- if (match) {
- match[1]
- } else {
- "-"
- }
- } else {
- "-"
- }
- - name: Vonal
- data: next_departures_lines
- modify: |-
- if (typeof x === 'string' && x.length > 0) {
- var match = x.match(/\(([^)]+)\)/);
- if (match) {
- var parts = match[1].split('/');
- if (parts.length > 1 && parts[0] === "None") {
- parts.splice(0, 1); // Remove the "None" part
- }
- parts.join('/');
- } else {
- "-"
- }
- } else {
- "-"
- }
- max_rows: 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement