-
-
Notifications
You must be signed in to change notification settings - Fork 60
Fix AWS brightness scaling and treat zero brightness as “off” #1132
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
Open
cybermancerr
wants to merge
21
commits into
homebridge-plugins:latest
Choose a base branch
from
cybermancerr:patch-1
base: latest
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
Hi @cybermancerr are you on discord at all? and if so, in the homebridge server? |
Yes and I just joined that server. My profile name is WhiteCrowSecurity. Also, I have discord server for https://whitecrowsecurity.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
… cmd
Fixes problems with AWS brightness scaling and adds the capability to turn off the device if brightness is set to “0”. Currently, if a Govee device receives a brightness of “0” over AWS, LAN, or BLE it defaults to a brightness of “1” and never actually turns off. This code update corrects the scaling issues reported by other users and ensures the device truly powers off when brightness is reduced to zero.
Current situation
Right now in
sendDeviceUpdate
, the ‘brightness’ case always sends a brightness command—even when the incoming value is zero. Because AWS and BLE implementations rarely accept a zero-level brightness, they clamp it up to one, leaving the light on at its lowest level instead of off. In addition, older code was applying a scaling multiplier for AWS devices that caused non-linear or off-by-one brightness on some models.and
Users have reported:
Proposed solution
Short-circuit brightness equals zero
If the incoming value is zero, immediately send an off command to AWS, BLE and LAN, which properly powers the device off.
Simplify AWS scaling
Always send the raw brightness value when greater than zero, rather than applying a hard-to-tune multiplier.
Replace the existing ‘brightness’ block with:
and
Release Notes
Additional Information
sendDeviceUpdate
method in the main platform classTesting
Manual device test
Automated mocks
sendDeviceUpdate
to verify that for a brightness value of zero you generate an off command rather than a brightness commandReviewer Nudging
case 'brightness'
block insendDeviceUpdate
(around line 1400 inindex.js
or wherever that method lives)Video of controling 12 H6010 after patching the plugin with the proposed changes leveraging DMXSmartLink Software:
https://youtu.be/6w97MaAxoMA