Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sensor.py #28

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Update sensor.py #28

merged 1 commit into from
Dec 28, 2023

Conversation

M-See
Copy link
Contributor

@M-See M-See commented Dec 28, 2023

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

@FaserF FaserF merged commit e438bfe into FaserF:main Dec 28, 2023
4 checks passed
@FaserF
Copy link
Owner

FaserF commented Dec 28, 2023

Thanks, this definitly is a better way than before!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants