zacs / ha-gtfs-rt

Real-time transit information for Home Assistant
MIT License
68 stars 30 forks source link

Next Bus Due In Attribute #11

Closed InTheDaylight14 closed 2 years ago

InTheDaylight14 commented 2 years ago

Hello,

I added a "Next Bus Due In" attribute that will provide the min until the next bus assuming the a next bus is known. If not it will default to "-".

Often by Sensor state goes into the negative and the bus has already past my stop. With this attribute I can expose the minutes until the next bus arrives, just like the main state of the sensor.

I also setup the TIME_STR_FORMAT variable to be used when specifying the time format of the arrival times. I was after 24 hour time format. This can be removed from the PR if desired. Really only after the Next Bus Due In attribute.

Thanks, Kyle

InTheDaylight14 commented 2 years ago

Forgot to mention, I tested this on my HA installation. Didn't run into any issues