[hue] Fix handling of identical scene names (API v2) #15976
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you CREATE a new scene in the Hue app, it checks for already existing scenes having the same name. So normally it is impossible to create duplicate scenes with the same name.
However there is a bug in the Hue app whereby if you EDIT a scene, it wrongly allows you to rename the scene to the same name as another existing scene. And when OH tries to load the scenes for such a particular thing, it throws a
Collectors.duplicateKeyException.This PR eliminates that
Collectors.duplicateKeyException.Main UI does not permit drop down selectors to have multiple choices with the same text, so the second scene instance is simply not added to the list.
Signed-off-by: Andrew Fiddian-Green software@whitebear.ch