Skip to content

Update battery-health extension - #16028

Closed
menahishayan wants to merge 2 commits into
raycast:mainfrom
menahishayan:ext/battery-health
Closed

menahishayan wants to merge 2 commits into
raycast:mainfrom
menahishayan:ext/battery-health

Conversation

@menahishayan

@menahishayan menahishayan commented Dec 24, 2024 •

Copy link
Copy Markdown
Contributor

Description

feat: ✨ added the ability to view your battery's health relative to when it was new

Screencast

Screenshot 2024-12-24 at 2 02 43 PM

Checklist

- chore: 🔧 add publish script
- feat: ✨ added battery health information
- Initial commit
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: battery-health Issues related to the battery-health extension labels Dec 24, 2024
@raycastbot

raycastbot commented Dec 24, 2024 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @o1y you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

Due to our current reduced availability, the initial review may take up to 10-15 business days 🎄

@o1y

o1y commented Dec 24, 2024

Copy link
Copy Markdown
Contributor

Thanks for your contribution @menahishayan! As far as I understand, the Health value cannot be accurately represented using the following calculation:

values["health"] = ((AppleRawMaxCapacity / DesignCapacity) * 100).toFixed(1) + "%";

The result doesn't align with the health information displayed in the system report. When I developed the extension, I couldn't find a reliable way to extract that value directly. In my case, the calculated value is significantly lower than the one provided by Apple, which could be confusing for users.

@menahishayan

menahishayan commented Dec 24, 2024 •

Copy link
Copy Markdown
Contributor Author

Hey @o1y,

Thanks for the info. I've compared this value with other popular apps like CoconutBattery and the value is consistent with what they display.

While it may not be exactly the same as the System Report, it's close enough to a point where I believe it's more useful to show the value than to omit it entirely.

Also, if you, or anyone else has ideas on how this calculation can be improved, it would be great to discuss it further before we make a decision on this.

@menahishayan

Copy link
Copy Markdown
Contributor Author

Update: I've changed the calculation to be slightly more accurate to the System Report value. It's not 100% but the margin of error is now smaller.

@o1y o1y mentioned this pull request Dec 24, 2024
5 tasks done
@o1y

o1y commented Dec 24, 2024

Copy link
Copy Markdown
Contributor

I've added the Maximum Capacity value from the system profiler in #16032.

@menahishayan

Copy link
Copy Markdown
Contributor Author

Closing in favor of #16032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: battery-health Issues related to the battery-health extension extension fix / improvement Label for PRs with extension's fix improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants