Skip to content

Commit

Permalink
Use async sleep while retrying to connect
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusTrafi committed Feb 8, 2022
1 parent 2b44c6c commit 00f7219
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion custom_components/salus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Support for Salus iT600."""
import logging
import time
from asyncio import sleep

from homeassistant import config_entries, core
from homeassistant.helpers import device_registry as dr
Expand Down Expand Up @@ -52,7 +53,7 @@ async def async_setup_gateway_entry(hass: core.HomeAssistant, entry: config_entr
if remaining_attempts == 0:
raise e
else:
time.sleep(3)
await sleep(3)
except IT600ConnectionError as ce:
_LOGGER.error("Connection error: check if you have specified gateway's HOST correctly.")
return False
Expand Down
2 changes: 1 addition & 1 deletion custom_components/salus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"codeowners": [
"@jvitkauskas"
],
"version": "0.3.2"
"version": "0.3.3"
}

0 comments on commit 00f7219

Please sign in to comment.