Skip to content

Commit

Permalink
Bump py-smart-gardena version and trying to correct loooong home assi…
Browse files Browse the repository at this point in the history
…stant startup issue
  • Loading branch information
grm committed Jul 16, 2022
1 parent b405253 commit 58c882f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions custom_components/gardena_smart_system/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Support for Gardena Smart System devices."""
import asyncio
import logging

from gardena.exceptions.authentication_exception import AuthenticationException
Expand Down Expand Up @@ -71,10 +72,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
class GardenaSmartSystem:
"""A Gardena Smart System wrapper class."""

def __init__(self, hass, *, client_id, client_secret, smart_system=SmartSystem):
def __init__(self, hass, client_id, client_secret):
"""Initialize the Gardena Smart System."""
self._hass = hass
self.smart_system = smart_system(
self.smart_system = SmartSystem(
client_id=client_id,
client_secret=client_secret)

Expand All @@ -94,8 +95,8 @@ async def start(self):
await self.smart_system.update_devices(location)
self._hass.data[DOMAIN][GARDENA_LOCATION] = location
_LOGGER.debug("Starting GardenaSmartSystem websocket")
self._hass.async_create_task(self.smart_system.start_ws(self._hass.data[DOMAIN][GARDENA_LOCATION]))
_LOGGER.debug("Websockete connected !")
asyncio.create_task(self.smart_system.start_ws(self._hass.data[DOMAIN][GARDENA_LOCATION]))
_LOGGER.debug("Websocket thread launched !")
except AuthenticationException as ex:
_LOGGER.error(
f"Authentication failed : {ex.message}. You may need to check your token or create a new app in the gardena api and use the new token.")
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gardena_smart_system/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"issue_tracker": "https://github.com/py-smart-gardena/hass-gardena-smart-system/issues",
"dependencies": [],
"codeowners": ["@py-smart-gardena"],
"requirements": ["py-smart-gardena==1.3.1"]
"requirements": ["py-smart-gardena==1.3.2"]
}

0 comments on commit 58c882f

Please sign in to comment.