Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Spools in UI on API call #28

Closed
wants to merge 3 commits into from

Conversation

oschwartz10612
Copy link

Allows a client to update the ui when inserting or selecting spools. Previously a reload of the page was required.

Example api call:

url = 'http://localhost/plugin/filamentmanager/selections/0'
    headers = {'X-Api-Key': config.API_KEY}
    payload = {
        "selection": {
            "tool": 0, 
            "spool": {
                "id": id
            }   
        },
        "update": True
    }

The update:True is required to prevent normal calls from unnecessarily updating.

I am using this in my project here to update spools when scanned with a barcode scanner.

@stale
Copy link

stale bot commented Jan 4, 2021

This issue has been automatically marked for closing, because it has not had activity in 30 days. It will be closed if no further activity occurs in 10 days.

@stale stale bot added the status: markedForAutoClose Issue will be closed automatically label Jan 4, 2021
@oschwartz10612
Copy link
Author

@OllisGit Any chance you want to take a look before Mr. Stale closes my request?

@stale stale bot removed the status: markedForAutoClose Issue will be closed automatically label Jan 4, 2021
@OllisGit
Copy link
Owner

Hi @oschwartz10612 ,

thanks for the PR. I would like to implement your PR with a small change.

Instead of the keyword update (in the payload) I would like to use the more precise word notifyclient or updateui.

What do you think?

PS. Sorry, for being late to the party, but I made a "Octoprint sabatical" (no coding, no printing) the last months.

@oschwartz10612
Copy link
Author

Hi!

No problem, it is important to take breaks!

I think you are correct. updateui is more explicit and will reduce confusion. I already made the change.

Is there anything else you would like to see changed?

Thanks for your work on the project!

@OllisGit
Copy link
Owner

Hi @oschwartz10612,
you PR was not working! Now it is fixed and will be in the next release.

@OllisGit OllisGit added status: inNextRelease Will be implemented/fixed in next release type: enhancement New feature or request and removed status: inProgress labels Jan 28, 2021
@oschwartz10612
Copy link
Author

I believe I fixed the conflict. Let me know if it is unsatisfactory.

OllisGit added a commit that referenced this pull request Jan 28, 2021
- MR #15 inform external ui (like OctoDash) about filament change. Credit goes to @gdombiak
- MR #28 creating and selecting a spool via API. Credit goes to @oschwartz10612
OllisGit added a commit that referenced this pull request Jan 28, 2021
- MR #15 inform external ui (like OctoDash) about filament change. Credit goes to @gdombiak
- MR #28 creating and selecting a spool via API. Credit goes to @oschwartz10612
@OllisGit OllisGit removed the status: inNextRelease Will be implemented/fixed in next release label Jan 28, 2021
@OllisGit
Copy link
Owner

Release 1.7.0 is out.
Please test and give a feedback via issue tracker if you receive an error.

@OllisGit OllisGit closed this Jan 28, 2021
@OllisGit OllisGit mentioned this pull request Feb 1, 2021
@oschwartz10612 oschwartz10612 deleted the api_update_ui branch February 12, 2021 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants