Salut,
voici le code:
- type: custom:button-card
name: Suivre colis
color_type: icon
color: rgb(68, 115, 158)
icon: mdi:package
layout: icon_name_state
aspect_ratio: 4.55/1
size: 100%
styles:
card:
- padding: 0.2em
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
icon:
- opacity: 1
name:
- font-size: 1.15em
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
browser_id: THIS
size: normal
style: |-
--popup-min-width: 900px;
--popup-max-width: 1000px;
--popup-border-radius: 10px;
--popup-padding-y: -15px;
--popup-padding-x: 5px;
content:
type: custom:stack-in-card
mode: vertical
keep:
box_shadow: false
margin: false
border_radius: true
background: false
outer_padding: false
cards:
- type: custom:mod-card
card:
type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: sensor.seventeentrack_packages_not_found
name: Introuvable
vertical: true
icon: mdi:package-variant-closed
style: |
ha-card {
box-shadow: none;
}
:host {
--card-mod-icon-color: #44739e;
}
- type: custom:mushroom-entity-card
entity: sensor.seventeentrack_packages_in_transit
name: En transit
vertical: true
icon: fas:shipping-fast
style: |
ha-card {
box-shadow: none;
}
:host {
--card-mod-icon-color: #44739e;
}
- type: custom:mushroom-entity-card
entity: >-
sensor.seventeentrack_packages_ready_to_be_picked_up
name: En livraison
vertical: true
icon: fas:shipping-fast
style: |
ha-card {
box-shadow: none;
}
:host {
--card-mod-icon-color: #44739e;
}
- type: custom:mushroom-entity-card
entity: sensor.seventeentrack_packages_delivered
name: Livrer
vertical: true
icon: mdi:package
style: |
ha-card {
box-shadow: none;
}
:host {
--card-mod-icon-color: #44739e;
}
- type: custom:flex-table-card
max_rows: 4
sort_by: timestamp-
clickable: true
entities:
include: sensor.seventeentrack_package_*
columns:
- data: tracking_number
icon: mdi:package-variant-closed
align: center
name: ' Numéro de suivi'
- name: Produits
data: friendly_name
align: center
- data: origin_country
name: Pays Origine
align: center
- data: destination_country
name: Pays Destination
align: center
- data: state
align: center
name: Statut
- data: info_text
name: Infos
align: center
- data: timestamp
align: center
name: Mise à jour
modify: >-
const hourDiff = (Date.now() - Date.parse(x)); const
secDiff = hourDiff / 1000; const minDiff = hourDiff
/ 60 / 1000; const hDiff = hourDiff / 3600 / 1000;
const hours = Math.floor(hDiff); const minutes =
minDiff - 60 * hours; const minr =
Math.floor(minutes); hours + " hours " + minr + "
minutes"
prefix: 'Depuis '
css:
thead th:nth-child(2): 'background-color: #44739e'
thead th:nth-child(3): 'background-color: #44739e'
thead th:nth-child(4): 'background-color: #44739e'
thead th:nth-child(5): 'background-color: #44739e'
thead th:nth-child(6): 'background-color: #44739e'
thead th:nth-child(7): 'background-color: #44739e'
style: |
:host {
--card-mod-icon-color: #44739e;
font-size: 13px;
}
style: |
ha-card {
border-radius: 5px;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.7);
}