tdorssers / TeslaPy

A Python module to use the Tesla Motors Owner API
MIT License
374 stars 84 forks source link

Fixed corner case bug in tariff generation. #87

Closed 696GrocuttT closed 2 years ago

696GrocuttT commented 2 years ago

In some corner cases a background time slot can be completely replaced by forground time slots. For example in this sequence

off peak -> peak -> mid peak -> peak -> off peak

If the mid peak slot is added after the peak slots the background time slot covering that period needs to be removed. The previous version left a zero length background slot that caused the Tasla API to reject the tariff.