Fix XHS2-UE battery voltage curve#12609
Merged
Koenkk merged 1 commit intoJul 4, 2026
Merged
Conversation
Owner
|
Could you fix the merge conflict? |
dd0d922 to
590fd3e
Compare
Contributor
Author
|
Thanks for the heads up. I rebased the branch on the latest upstream master and resolved the merge conflict. |
Owner
|
Thanks! |
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
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.
Summary
Fixes #12608.
This updates the Universal Electronics Inc
XHS2-UE/URC4460BC0-X-Rcontact sensor battery curve to derive percentage from measured voltage:voltageToPercentagefrom3V_2100to{min: 2500, max: 2800}2800mVreports100%even when the device reports a stale27%Why
This is the same behavior fixed for the Sylvania
74388contact sensor in #12486: after a fresh battery change, the device can report a healthy/full voltage while also reporting a stale low battery percentage.For
XHS2-UE, the observed state was:{ "battery": 27, "battery_low": false, "contact": true, "linkquality": 188, "tamper": false, "temperature": 20, "voltage": 2800 }Using
{min: 2500, max: 2800}matches the previously merged Sylvania fix and treats2800mVas full.Tests
pnpm exec vitest run --config ./test/vitest.config.mts test/fromZigbee.test.tspnpm run checkpnpm run buildpnpm run checkpnpm test