-
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 battery voltage attribute support #11210
feat(zigbee): Add battery voltage attribute support #11210
Conversation
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
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 76 files 76 suites 12m 41s ⏱️ Results for commit 6eed3db. ♻️ This comment has been updated with latest results. |
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.
Pull Request Overview
This PR adds battery voltage attribute support to the Zigbee Power Config Cluster by updating method signatures and implementations to accept battery voltage along with battery percentage.
- Updated ZigbeeEP.h to introduce a new parameter and method for battery voltage.
- Modified ZigbeeEP.cpp to update the setPowerSource method and implement setBatteryVoltage with corresponding error handling.
- Adjusted the Sleepy example to include the battery voltage parameter in the demonstration.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
libraries/Zigbee/src/ZigbeeEP.h | Added battery voltage parameter to setPowerSource and a new setBatteryVoltage method. |
libraries/Zigbee/src/ZigbeeEP.cpp | Adjusted method signature for setPowerSource and implemented setBatteryVoltage; contains an incorrect error message for battery voltage. |
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino | Updated the example to use the new method signature with battery voltage. |
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…_Temp_Hum_Sensor_Sleepy.ino Co-authored-by: Copilot <[email protected]>
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 pull request includes updates to the Zigbee Power Config Cluster adding a battery voltage functionality. The most important changes involve adding support for setting and reporting battery voltage in addition to battery percentage.
Enhancements to battery management:
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy/Zigbee_Temp_Hum_Sensor_Sleepy.ino
: Updated thesetup
function to include setting battery voltage along with battery percentage.libraries/Zigbee/src/ZigbeeEP.cpp
: Modified thesetPowerSource
method to accept battery voltage as an additional parameter and added a new methodsetBatteryVoltage
to update the battery voltage attribute. [1] [2] [3]libraries/Zigbee/src/ZigbeeEP.h
: Updated theZigbeeEP
class definition to include the new battery voltage parameter in thesetPowerSource
method and added a new methodsetBatteryVoltage
.Note: Battery Voltage attribute is not reportable, that's why there is no report method for that.
Tests scenarios
Tested using Sleepy example and HomeAssistant ZHA integration (only battery % was shown, but I was able to read the voltage value).
Related links
Closes #11177