Skip to content
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

Report battery percentage in BLE BTHOME_V2 protocol #188

Merged
merged 2 commits into from
Apr 20, 2024
Merged

Conversation

jrhbcn
Copy link
Contributor

@jrhbcn jrhbcn commented Apr 20, 2024

Changes in BTHOME_V2 protocol:

Changes in BTHOME_V2 protocol:
- Reduce resolution of humidity and moisture to 1 byte
- Add battery percentage
@jrhbcn
Copy link
Contributor Author

jrhbcn commented Apr 20, 2024

The 0.5f is for rounding the float value to uint8_t. So values 89.9% map to 90% instead of 89%. It might be overkill if our resolution is 2% but I think it is better to leave it like this so we do not add an extra error in the conversion.

I have modified the files, let's see if I caught all trailing whitespaces.

@rbaron
Copy link
Owner

rbaron commented Apr 20, 2024

Awesome. That looks great. Tks @jrhbcn!

@rbaron rbaron merged commit e7e4b77 into rbaron:main Apr 20, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants