Add device-restricted off to min brightness feature #9
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.
In IKEA Zigbee implementation controllers have the ability to turn on the connected bulb (or light group) at minimum brightness if the action to increment brightness occurs (i.e. pressing the dedicated button for a
E1810
, turning the device to the right for aICTC-G-1
etc.).This PR implements the feature, which can be device restricted, since not all controllers which will be integrated in the future could be designed to have this capability.
The
supports_from_off_to_min_brightness()
method, which can be overridden by every controller, defines whether the device supports this feature or not. By default, devices will not implement this feature.Also, I had to edit
before_action()
signatures, passing action arguments to the methods, something that could come in handy if more complex checks will have to be performed in the future.I succesfully tested and enabled the feature on
E1810
andE1743
controllers. I left theICTC-G-1
unsupported since the integration is quite unstable and there are still issues with handling duplicate and unwanted messages.