c’est quoi le valuer de input_select.direction_bus? Essaie avec | int aussi
En fait…c’est pas vraiment qqc de gtfs mais plutôt templating, je te conseille d’apprendre ça.
type: vertical-stack
cards:
- type: entities
entities:
- entity: input_select.direction_bus
- type: markdown
content: >-
<table> {% set next =
state_attr('sensor.llglamb3_local_stop_zone_place_st_lambert','next_departures_lines')%}
{% for i in range(0, next | count, 1) %} {%- if
state_attr('sensor.llglamb3_local_stop_zone_place_st_lambert','next_departures_lines')[i].direction_id
== states("input_select.direction_bus") | int -%}
<tr> <td>{{
state_attr('sensor.llglamb3_local_stop_zone_place_st_lambert','next_departures_lines')[i].route
}}</td> <td>{{
state_attr('sensor.llglamb3_local_stop_zone_place_st_lambert','next_departures_lines')[i].departure
}}</td> <td>{{
state_attr('sensor.llglamb3_local_stop_zone_place_st_lambert','next_departures_lines')[i].stop_name
}}</td> <td>{{
state_attr('sensor.llglamb3_local_stop_zone_place_st_lambert','next_departures_lines')[i].direction_id
}}</td> {% endif %} {% endfor %}
card_mod:
style:
.: |
ha-card ha-markdown {
padding:0px
border-top: 1px groove var(--divider-color);
overflow-y: scroll;
height: 300px;
}
ha-card ha-markdown.no-header {
padding:0px
}
$: |
h1.card-header {
background-color:rgb(100, 100, 100);
padding: 0px 0px 0px 12px !important;
color: white !important;
font-weight: normal;
font-size: 1.5em !important;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
height: 100%;
}
ha-markdown $: |
h1 {
font-weight: normal;
font-size: 24px;
}
table{
border-collapse: collapse;
font-size: 0.9em;
font-family: Roboto;
width: 100%;
outline: 0px solid #393c3d;
margin-top: 10px;
}
td {
padding: 5px 5px 5px 5px;
text-align: left;
border-bottom: 0px solid #1c2020;
}
tr:nth-of-type(even) {
background-color: rgb(54, 54, 54, 0.3);
}
Avec -int, cela fonctionne
merci
1 « J'aime »