Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local API without Cloud API #4

Closed
bobvanderlinden opened this issue Mar 28, 2021 · 2 comments
Closed

Local API without Cloud API #4

bobvanderlinden opened this issue Mar 28, 2021 · 2 comments

Comments

@bobvanderlinden
Copy link

The README says to configure the cloud API using:

slide:
  username: XXX
  password: XXX

and the local API using:

cover:
  - platform: slide
    host: XXX
    password: XXX

However, whenever I configure the local API without configuring the cloud API, slide will fail to initialize:

2021-03-28 01:30:54 ERROR (MainThread) [homeassistant.setup] Error during setup of component slide
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/config/custom_components/slide/__init__.py", line 146, in async_setup
username = config[DOMAIN][CONF_USERNAME]
KeyError: 'slide'

This makes sense, as __init__.py always tries to read the username from its configuration. This fails, because I don't have a slide: section in my configuration.

I added the following to init.py to get around the problem, but I wasn't sure this is just a hack or a proper fix:

    if not DOMAIN in config:
        _LOGGER.debug("Slide Cloud API not configured")
        return True
@MartVisser
Copy link
Contributor

Same issue here, and "fixed" it the same way as @bobvanderlinden

@ualex73 ualex73 closed this as completed in 61da9a9 Dec 5, 2021
@ualex73
Copy link
Owner

ualex73 commented Dec 5, 2021

Sorry, I didn't see this issue (didn't get an email). I officially put it in the init.py file now, thanks for reporting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants