FakeShell / batman

A battery management service and program for Linux phones
GNU General Public License v2.0
8 stars 8 forks source link

Add functionality to create state file and read states on startup #8

Closed JZX100II closed 8 months ago

JZX100II commented 8 months ago

Added methods to create state file: CreateStateFile will create the state file with a default of 'Driver': 'batman', 'Profile': 'balanced'. SetState will set states in the file. It takes in the driver and profile as arguments. Profile setter and getter have also been added. GetThermal uses gth to get thermal zones and average temperature. UpdatePerformanceDegraded uses temp_avg to update the PerformanceDegraded property. The Async function(thermal_check) runs every 5 seconds in the main to keep temp_avg monitoring. If there's a state file on startups, it will set the profile to the existing one.

FakeShell commented 8 months ago

as this now uses GTherm, it would be appropriate to add the gir1.2 dependency to https://github.com/FakeShell/batman/blob/all/debian/control#L108 in the same PR (separate commits tho) overall, LGTM