fix bug where random_fetch_time_offset: 0 leads to an error because random.randrange(0, 0) is called

This commit is contained in:
5ila5
2024-06-02 15:29:41 +02:00
committed by 5ila5
parent d22da9b9d0
commit 942b736739

View File

@@ -225,7 +225,9 @@ class WasteCollectionApi:
def _fetch_callback(self, *_):
async_call_later(
self._hass,
randrange(0, 60 * self._random_fetch_time_offset),
randrange(0, 60 * self._random_fetch_time_offset)
if self._random_fetch_time_offset > 0
else 0,
self._fetch_now_callback,
)