Add delay to retry

This commit is contained in:
Micha Horlboge 2022-02-21 22:52:06 +01:00
parent f6600c7dda
commit 52c0e90a52
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
name: "Fritz!Box Temperature Sync"
description: "Sync Fritz!DECT thermostat temperatures with other sensors in Home Assistant"
version: "0.3.0"
version: "0.3.1"
startup: "application"
stage: "experimental"
slug: "fritz_temp_sync"

View File

@ -37,6 +37,8 @@ class HomeAssistantAPI:
except InvalidStatusCode:
if retries > 0:
retries -= 1
await asyncio.sleep(10)
logging.info("Retry home assistant connection...")
continue
else:
logging.error("Invalid status code while connecting to Home Assistant")