{"id":20775561,"url":"https://github.com/fleaz/battery-refresh","last_synced_at":"2026-04-21T15:33:06.391Z","repository":{"id":187732641,"uuid":"677468539","full_name":"fleaz/battery-refresh","owner":"fleaz","description":"Automatically cycle your laptop battery with a smart socket","archived":false,"fork":false,"pushed_at":"2023-08-11T17:00:54.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T07:48:03.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fleaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-11T16:41:22.000Z","updated_at":"2023-08-11T17:00:06.000Z","dependencies_parsed_at":"2023-08-11T23:46:18.345Z","dependency_job_id":"a9516efc-c8fc-4e82-af0c-229736e8204b","html_url":"https://github.com/fleaz/battery-refresh","commit_stats":null,"previous_names":["fleaz/battery-refresh"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleaz%2Fbattery-refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleaz%2Fbattery-refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleaz%2Fbattery-refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleaz%2Fbattery-refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fleaz","download_url":"https://codeload.github.com/fleaz/battery-refresh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243114077,"owners_count":20238536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T12:37:38.113Z","updated_at":"2026-04-21T15:33:01.336Z","avatar_url":"https://github.com/fleaz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# battery-refresh\n\nUse a smart socket to automatically refresh your laptop battery.\n\n\n## Usecase\nAfter a few years of home office, my laptop battery was pretty bad because my work laptop spend 24/7 in a docking\nstation. To get a bit of capacity back I thought about running a few charge/discharge cycles. This is a common feature\nto refresh old batteries (mainly due to better battery circuit calibration) and can e.g. be done with the Thinkvantage\ntools on Windows if you own a Thinkpad.\n\nBecause I have a Dell XPS, I needed a different approach. And because I have Home Assistant, my idea was to use a smart\nsocket and just turn it on/off based on the current battery charge level.\n\n\n## Usage\nOpen the `main.py` and adapt the variables on top of the script to your setup. The code was created quite late in the\nnight, so it's not that beautiful, but it get's the job done :D\n\nAfter that, just plug the charger in the smart socket, conenct your laptop to the charger and start the script. Then let\nit run as long as you like.\n\nDepending on the performance of your battery, you probably don't want to set the THRESH_LOW to low, so it won't turn off\nbefore reaching it. Setting THRESH_HIGH to 100 is also not recommended because modern lithium batteries don't like to be\ncompletly full or completly empty.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleaz%2Fbattery-refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffleaz%2Fbattery-refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleaz%2Fbattery-refresh/lists"}