awtrix / AWTRIX2.0-Apps

Latest Apps for AWTRIX 2.0.
BSD 2-Clause "Simplified" License
112 stars 49 forks source link

Percentage progress over the octoprint app #20

Open SehlingS opened 3 years ago

SehlingS commented 3 years ago

Hey,

i use the octoprint awtrix app with the octoprint plugin printtimegenius (https://github.com/eyal0/OctoPrint-PrintTimeGenius). There a new calculation about the percentage progress is implemented. Normally the Percentage progress in octoprint is based on the xxxKB / xxxKB. That is very inaccurate. The plugin printtimegenius change this calculation to a time based one and changed the displyed value in the octoprint gui.

The problem is, that the plugin don't change the percentage deep in the octorpint system, so you get the old values over the api. MQTT also sends out the old inaccurate one.

Is it possible, that you don't use the % value from the api but calculate the value with the print time and the print time left. Maybe a option to change between the calculated and the api one.

Here a example how the octoprint plugin will do this. self.printerStateViewModel.progress( (data.printTime||0) / ((data.printTime||0) + (data.printTimeLeft))

I'm not sure if you get this both times over the api request. MQTT will send it out.

Best regards and thank you in advanced Sascha

SehlingS commented 3 years ago

Hello again, i think you can get both required values over the api. https://docs.octoprint.org/en/master/api/job.html

"progress": { "completion": 0.2298468264184775, "filepos": 337942, "printTime": 276, "printTimeLeft": 912