power: in process_request replace notify_power_changed with process_power_changed #987
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the powerstate was changed by third party, and a power on request is sent, moonraker is now able to start klippy properly.
My previous workflow was:
I go to the printer, check if it has power and see that it doesn't have power.
Therefore, I push the button on wireless socket thingy, which makes my printer light up and pull up Mainsail on my Laptop/Phone.
There is the popup to toggle to power on the printer, because it didn't notice that it was switched on manually (which is fine).
So I press the "power on" button in the UI, it displays the "moonraker can't connect" and stays at this screen, because it is stuck in the codepath where it just sent a notification, but doesn't try to restart klippy.
In that case the button to power on or off isn't displayed at all anymore and there is no obvious way to get out of this, other than restarting the moonraker systemd-service.
process_power_changed should call notify_power_changed as well, I don't see incompatibilities, but I am new to the codebase :)
I tested this on my printer.
Thank you very much for this awesome piece of software in the open-source 3D-printing-stack!!
MrSmör ^^