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

Fix battery calculation #27

Merged
merged 25 commits into from
Feb 5, 2024
Merged

Fix battery calculation #27

merged 25 commits into from
Feb 5, 2024

Conversation

LaStrada
Copy link
Member

@LaStrada LaStrada commented Jan 29, 2024

This PR fixes:

  • Battery % for all devices, except Wave gen. 1 which doesn't publish any voltage
  • Refactor illuminance for all devices, only Wave gen. 1 gives a real value, the rest of the devices gives a percentage value, which will be ignored for now
  • Improved handling of optional values

@LaStrada LaStrada marked this pull request as ready for review January 29, 2024 15:02
@LaStrada LaStrada requested a review from HormCodes January 29, 2024 15:02
@LaStrada LaStrada self-assigned this Jan 29, 2024
@LaStrada LaStrada mentioned this pull request Jan 29, 2024
Copy link
Member

@HormCodes HormCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I tested the code with local HA and it seems to work as it should. 👍

I have a couple of comments for small possible adjustments. However, nothing serious. 🙂

airthings_ble/device_type.py Outdated Show resolved Hide resolved
tests/test_device_type.py Show resolved Hide resolved
airthings_ble/device_type.py Outdated Show resolved Hide resolved
airthings_ble/device_type.py Outdated Show resolved Hide resolved
@LaStrada LaStrada merged commit 1b58d2c into main Feb 5, 2024
1 check passed
@LaStrada LaStrada deleted the fix-battery-calculation branch February 5, 2024 19:42
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.

2 participants