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.
Hi @cdjackson ,
I know this is the third pull request regarding association handling, but just like last time it fixes my particular problems and maybe you deem it a general problem / fix, so I just want to put it out there.
I tried to find out what is really causing UI problems regarding group associations and after the last pull request, habmin is working correctly for me whereas paperUI is not. (short discussion #43)
paperUI displays associations depending on the device's configuration and expects this configuration in a specific format:
if the group can have multiple members, it expects a list, and if not, it expects just the member.
The group configuration in the binding is set irregardless of the device being able to have multiple members - it returns as a list if there are multiple members and it returns the first member if it is currently the only member. When there is no member currently set, it returns an empty string.
I changed it so that the device's configuration is taken into account in the ZWaceThingHandler and it sets and return its group association members depending on the device being able to have multiple members in that particular group.
I.e. if the device can have multiple members, a list is always returned (even if there are no members).
I think this behaviour is more intuitive and what I would expect when asking for or setting group members.
Additionally, paperUI and habmin are working without any problems when setting and displaying group associations now.
I added a few fixes like preventing to add nodes as group members if the node is not know by the controller or adding multiple members if the device can only have one member.
Signed-off-by: James Tophoven [email protected]