Allow to disable turning on light with brightness up command #799
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.
Thank you for taking the time to work on a Pull Request. Your contribution is really appreciated! 🎉
Please don't delete any part of the template, since keeping the provided structure will help maintainers to review your work more rapidly.
Sections marked as * are required and need to be filled in.
Proposed change*
This adds a configuration option to the light hook, which allows to disable turning on a light with brightness up command. Right now, when a light is turned off and brightness up command (both single or repeat) is received, the light will be turned on. As this might not be wanted all the time, when unchecking the option, brightness up commands will be dropped when a light is turned off.
The functionality of the smooth power on option stays unchanged but is now dependent of the newly added option.
The initial reason, why I looked into this, is fixed with the second commit of this PR. My particular light (a Zigbee group of two lights) takes some time to report the brightness value after being turned on. Even after the transition time, it takes another 50 to 100 milliseconds until a brightness value is reported. To deal with this, I introduced a wait action with a timeout of 1 second.
Checklist*
npm run format
before submitting my Pull Request.