fjxmlzn / FindMyHistory

Track your Apple devices and look up their past location, battery levels, and more
MIT License
308 stars 34 forks source link

BatteryLevelConversion #14

Closed SandiyosDev closed 1 year ago

SandiyosDev commented 1 year ago

Displays battery level percentage via conversion (and rounding errors), otherwise if battery status is unknown then set null; and some other small stuff.

fjxmlzn commented 1 year ago

Thank you! This is nice! But personally, I would separate these post-processing logics outside this repo. E.g., if users want to post-process battery levels, they can call log_manager (which is designed to extract things as-is from FindMy logs) and do post-processing using the output however they want. This would make the code structure more modular and cleaner than adding all possible post-processing logic (which could be different for different use cases) inside one class.

SandiyosDev commented 1 year ago

Understood, what about adding arguments to allow users to specify post processing logic? I understand it would be another feat of its own, but we can perhaps take a more modular approach.

fjxmlzn commented 1 year ago

Do you mean arguments to the constructor of LogManager?

One simple way for users is to inherit from LogManager, and override the methods as needed.