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" name: "Fritz!Box Temperature Sync"
description: "Sync Fritz!DECT thermostat temperatures with other sensors in Home Assistant" description: "Sync Fritz!DECT thermostat temperatures with other sensors in Home Assistant"
version: "0.3.0" version: "0.3.1"
startup: "application" startup: "application"
stage: "experimental" stage: "experimental"
slug: "fritz_temp_sync" slug: "fritz_temp_sync"

View File

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