Add delay to retry
This commit is contained in:
parent
f6600c7dda
commit
52c0e90a52
@ -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"
|
||||||
|
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user