-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
feat(zigbee): Add setLight APIs to manually operate lights #10626
feat(zigbee): Add setLight APIs to manually operate lights #10626
Conversation
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
05a07fc
to
cdc1a42
Compare
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
Test Results 62 files 62 suites 7m 46s ⏱️ For more details on these failures, see this check. Results for commit cdc1a42. |
@@ -98,6 +102,8 @@ void loop() { | |||
Zigbee.factoryReset(); | |||
} | |||
} | |||
// Increase blightness by 50 every time the button is pressed | |||
zbColorLight.setLightLevel(zbColorLight.getLightLevel() + 50); |
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.
How would it overflow? Maybe it is necessary to promote something to uint16_t in order to get the u8 from uint16_t & 0xFF final value?
Nervermind - overflow goes fine with 8 bits.
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 setLightLevel parameter is uint8_t so max is 255. When it overflows, it's starting from 0 + the overflowed value.
Its like that on purpose to have it simple :)
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.
LGTM
Description of Change
This PR adds APIs to the light endpoints to enable controlling them by itself.
The status of the Light is updated in the clusters, so the actual state is updated in the Smart home apps.
Tests scenarios
Tested locally with HomeAssistant.
Related links
Please provide links to related issue, PRs etc.
(eg. Closes #number of issue)