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

Permit some config_entry options to be unset without throwing #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aldahick
Copy link

@aldahick aldahick commented May 2, 2023

Not sure what changed, but when I updated my installation to the latest commit, it started throwing:

2023-05-02 08:09:00.843 ERROR (MainThread) [homeassistant.components.light] Error while setting up cync_lights platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/cync_lights/light.py", line 25, in async_setup_entry
    if not hub.cync_rooms[room]._update_callback and (room in config_entry.options["rooms"] or room in config_entry.options["subgroups"]):
KeyError: 'subgroups'

It seems safe to assume that an unset value is the same as an empty value, so this PR does that.

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

Successfully merging this pull request may close these issues.

1 participant