Closed FaserF closed 2 years ago
By the way, unfortunatly the official HA integration got removed, as your python code is using web scratching. Thats the reason I am now maintaining this integration unofficially https://github.com/FaserF/ha-deutschebahn
Looks good, thanks.
@FaserF i also released a updated package containing this fix to PyPi (version 0.25
)
This issue was detected by: https://github.com/FaserF/ha-deutschebahn/issues/1 This pull request should hopefully fix this.
The problem is the following:
Example 1:
delayed: 900 (00:15) original: 85500 (23:45)
fullday: 86400 (24:00)
Right now: delayed - original = negative number (incorrect) Correct: fullday - original + delayed 86400 - 85500 + 900 = 1800 (30 Minutes)
Example 2:
delayed: 1020 (00:17) original: 82320 (22:52)
fullday: 86400 (24:00)
Right now: delayed - original = negative number (incorrect) Correct: fullday - original + delayed 86400 - 82320 + 1020 = 5100 (85 Minutes - 1 hour 25 minutes)