Skip to content

Commit

Permalink
Fixed: #4, when cloud is disable - do not throw an error
Browse files Browse the repository at this point in the history
  • Loading branch information
aakuiper committed Dec 5, 2021
1 parent 5da0e57 commit 61da9a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/slide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ async def retry_setup(now):
"""Retry setup if a connection/timeout happens on Slide API."""
await async_setup(hass, config)

if not DOMAIN in config:
_LOGGER.info("Slide Cloud API not configured")
return True

hass.data[DOMAIN] = {}
hass.data[DOMAIN][SLIDES] = {}

Expand All @@ -148,7 +152,9 @@ async def retry_setup(now):
scaninterval = config[DOMAIN][CONF_SCAN_INTERVAL]
verify_ssl = config[DOMAIN][CONF_VERIFY_SSL]

hass.data[DOMAIN][API_CLOUD] = GoSlideCloud(username, password, verify_ssl=verify_ssl)
hass.data[DOMAIN][API_CLOUD] = GoSlideCloud(
username, password, verify_ssl=verify_ssl
)

try:
result = await hass.data[DOMAIN][API_CLOUD].login()
Expand Down

0 comments on commit 61da9a9

Please sign in to comment.