I´m not a 100% convinced of this solution, but it´s more flexible like this. Especially for attributes that can then be read in to Lovelace-cards like Connection_card. Maybe it´s worth finding a better name, but now i changed the attributes name "Next on" to "Next 1" etc.
It´s up to you to decide on this change.
Alternatively, one could have manually inserted the following to make the "arrival" attribute available quickly:
small refactorization of attribute setting
I´m not a 100% convinced of this solution, but it´s more flexible like this. Especially for attributes that can then be read in to Lovelace-cards like Connection_card. Maybe it´s worth finding a better name, but now i changed the attributes name "Next on" to "Next 1" etc.
It´s up to you to decide on this change.
Alternatively, one could have manually inserted the following to make the "arrival" attribute available quickly:
connections["next_arrival"] = self.connections[1]["arrival"]
But with the proposed solution is automatically set for all connections directly.
Related Issues