Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Percentage progress over the octoprint app #20

Open
SehlingS opened this issue Jan 20, 2021 · 1 comment
Open

Percentage progress over the octoprint app #20

SehlingS opened this issue Jan 20, 2021 · 1 comment

Comments

@SehlingS
Copy link

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))
* 100);

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant