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

Fix missing light entities in options list #350

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

danaues
Copy link
Contributor

@danaues danaues commented Oct 28, 2022

When using the GUI to set options, if a light entity, which was previously configured, is no longer available, then it won't show up in the dropdown list, and causes the validation to fail.

Validation fails with this error:
image

This failure means there is no way to de-select the light entity, or change any options under this condition.

This PR compares the list of configured lights, to the all_lights variable, and if any are missing, appends them to all_lights. This allows the user to de-select the light, and make changes to the options.

Will resolve the following issues:
#349
#287
#278

@danaues
Copy link
Contributor Author

danaues commented Oct 28, 2022

Easy to reproduce by renaming a light entity that is already configured as part of an adaptive lighting config, then trying to modify that adaptive lighting configuration.

@danaues
Copy link
Contributor Author

danaues commented Oct 28, 2022

Ideally, another validation could be added, comparing the list of selected lights, to the current HA list of light entities, and warn the user if they have selected any lights that are not available.

@basnijholt
Copy link
Owner

This is awesome! Thank you so much 😄

@basnijholt basnijholt closed this Oct 28, 2022
@basnijholt basnijholt reopened this Oct 28, 2022
@basnijholt basnijholt merged commit 1efbbe3 into basnijholt:master Oct 28, 2022
@basnijholt
Copy link
Owner

Oops, I accidentally clicked on close instead of merge.

@basnijholt
Copy link
Owner

@danaues
Copy link
Contributor Author

danaues commented Oct 28, 2022

Thanks!

@danaues danaues deleted the missing_light_fix branch October 28, 2022 14:00
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.

2 participants