Closed xMuehlex closed 1 year ago
There seems to be a mistake here:
https://github.com/FaserF/ha-deutschebahn/blob/cfbe39d0e4756edc6251d49c482163e747eb914d/custom_components/deutschebahn/sensor.py#LL65C29-L65C29
While the config flow asks for the offset in minutes, the entered number in the code is converted to seconds. I have changed this line locally to self.offset = timedelta(minutes=config[CONF_OFFSET])
and it seems to more or less solve the problem. Smaller offsets seem to be ignored - but I suspect that this is the fault of the Deutsche Bahn website.
Can you also test this on your end and see if that solves the problem for you? Then I can create a PR.
@noxhirsch Just checked on my end and the slight code adjustment suggested by you works fine. Offset is now interpreted correctly. Thanks!
Thank you all for your input! And thanks for @noxhirsch to find the issue. New release 2.0.4 will fix this.
Hi FaserF. I probably found some minor issues with the new DB integration. The "offset" setting does not work, the normal departure time is always displayed without offset. I also noticed that a delayed train prevents the following trains from being displayed. It always displays the delayed train until it finally departs. However, I suspect the problem here is with the Fahrplan-API.
Feature request: The Fahrplan-API also knows the attributes "name", e.g. ICE 1234 and "track", i.e. the track number of the departure station. Would it be possible to integrate these attributes?
Thanks in advance xMuehlex