[Request] API should allow pause and unpause, not just pause-toggle #1393

Closed
MarcusWolschon opened this Issue Jun 30, 2016 · 3 comments

Comments

3 participants
@MarcusWolschon

MarcusWolschon commented Jun 30, 2016

Version 1.2.13 (master branch)

The API
http://docs.octoprint.org/en/master/api/job.html#issue-a-job-command
allows for a "command": "paus" described as:
"Pauses/unpauses the current print job."

Issue:
Issuing a pause command twice for any reason (timeout, response not parsed properly, script was restarted,..) resumes the print instead of keeping it paused.

In my case I'm using the pause command for a Filament monitor.
http://marcuswolschon.blogspot.de/2016/06/ultimaker-ii-filament-sensor-and-remote.html
Obviously having any chance of accidentally resuming a print instead of pausing it, is dangerous.

Proposal:
The current command is nice for user interfaces used exclusively by humans.
For automatic scripts it should offer 2 command to
pause and to resume a print regardless of state.

@GitIssueBot

This comment has been minimized.

Show comment
Hide comment
@GitIssueBot

GitIssueBot Jun 30, 2016

Collaborator

Hi @MarcusWolschon,

It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Please take a look at the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!).

If you did not intend to report a bug, please take special note of the title format to use as described in the Contribution Guidelines.

I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2016-07-14 05:10) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you!

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them.

Collaborator

GitIssueBot commented Jun 30, 2016

Hi @MarcusWolschon,

It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Please take a look at the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!).

If you did not intend to report a bug, please take special note of the title format to use as described in the Contribution Guidelines.

I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2016-07-14 05:10) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you!

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them.

@MarcusWolschon

This comment has been minimized.

Show comment
Hide comment
@MarcusWolschon

MarcusWolschon Jun 30, 2016

Relevant code:
https://github.com/foosel/OctoPrint/blob/master/src/octoprint/server/api/job.py#L40

def toggle_pause_print(self):

def toggle_pause_print(self):

Documentation to update:
https://github.com/foosel/OctoPrint/blob/692166f067329cd3d6fdc84389e0dd76184c5e0c/docs/features/action_commands.rst

Js code only needs to be updated if the user interface would make use of it, does it?

Relevant code:
https://github.com/foosel/OctoPrint/blob/master/src/octoprint/server/api/job.py#L40

def toggle_pause_print(self):

def toggle_pause_print(self):

Documentation to update:
https://github.com/foosel/OctoPrint/blob/692166f067329cd3d6fdc84389e0dd76184c5e0c/docs/features/action_commands.rst

Js code only needs to be updated if the user interface would make use of it, does it?

@MarcusWolschon MarcusWolschon changed the title from API should allow pause and unpause, not just pause-toggle to [Request] API should allow pause and unpause, not just pause-toggle Jun 30, 2016

foosel added a commit that referenced this issue Jun 30, 2016

@foosel

This comment has been minimized.

Show comment
Hide comment
@foosel

foosel Jun 30, 2016

Owner

Implemented in maintenance and devel branch, will be part of next release.

Simply changing the behaviour of the pause command and introducing a resume and toggle command was not possible due to reasons of backwards compatibility (there might be third party clients depending on the toggle behaviour). Instead a new optional action parameter was added to the existing pause command which can be either pause, resume or toggle. The latter will be assumed if the action parameter is not present. API docs are adjusted accordingly.

Owner

foosel commented Jun 30, 2016

Implemented in maintenance and devel branch, will be part of next release.

Simply changing the behaviour of the pause command and introducing a resume and toggle command was not possible due to reasons of backwards compatibility (there might be third party clients depending on the toggle behaviour). Instead a new optional action parameter was added to the existing pause command which can be either pause, resume or toggle. The latter will be assumed if the action parameter is not present. API docs are adjusted accordingly.

@foosel foosel closed this Jun 30, 2016

@foosel foosel added this to the 1.2.14 milestone Jun 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment