-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Scenes] Level control handler bugfix #29076
Merged
mergify
merged 2 commits into
project-chip:master
from
lpbeliveau-silabs:bugfix/level_control_handler
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But ApplyScene was not fixed, so this is broken.... How was this tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, If null value (255) for a uint8_t is stored, this will cause the ApplyScene to fail as we are asking to move to a value outside of the boundaries.
This will return failure to the Apply Scene. Is the expected behavior here to silently fail instead of explicitly letting the user know the scene wasn't applied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think the expected behavior is to move to the values that were stored in the scene, including a null level if that's what was stored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so we do not want that recall scene to end up in a failure.
How do we expect the level to behave to a null level? Value capped at maximum or lowest possible value, remaining at current level?
So basically, we either ignore the level command silently, ignore the whole scene returning an error (current implementation), or move to an unexpected level.
Say we explicitly add a scene with a null value, we could say this behaves as expected, but what if null is added from a save scene. This means the user just saved the current scene while the level value was null. This probably means the user was not expecting the level to have an impact when restoring the scene.
By that reasoning, should we decide that silently ignoring the move to null seems like the expected behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, how was it behaving when the scene was saved?
The questions you are asking are spec questions, not implementation questions, no? If the spec does not define this, it needs to...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MoveToLevel Command states that the command SHALL have the Level data field, constrained between 0 to 254. We do not respect that, therefore this should result in an error.
However the RecallScene states that the status of RecallScene at step 3 (applying EFS) SHALL be SUCCESS, so my initial interpretation seems wrong, silent failure seems to be the way here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does the spec say that recalling a scene involves a MoveToLevel command? Seems like if that's the intent the spec needs to say it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now does it have to be the actual moveToLevel command, the spec doesn't precise it. So we could technically create a separate function that allows us to move the level to "null" but that is still not defined right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpbeliveau-silabs Indeed.