Merge commit '3dbd8d3355059b4bb39d680b1a6deff9f6277c7e' into release

This commit is contained in:
张开科 2024-12-19 17:09:15 +08:00
commit c9cbdccb3a
2 changed files with 3 additions and 2 deletions

View File

@ -98,7 +98,6 @@ refresh_interval: 168
[update_manager klipper]
channel: stable
pinned_commit: e554ddb83c770a668a912d0e6ad23c1069bf6710
[update_manager KlipperScreen]
type: git_repo
@ -108,7 +107,6 @@ env: /home/klipper/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
channel: stable
pinned_commit: 629416d1f255f79f02a0341702bbc9bb8db694cb
[update_manager mainsail-config]
type: git_repo

View File

@ -54,6 +54,7 @@ class JobState:
logging.info(f"Job state initialized: {state}")
async def _status_update(self, data: Dict[str, Any], _: float) -> None:
kapis: KlippyAPI = self.server.lookup_component('klippy_apis')
if 'print_stats' not in data:
return
ps = data['print_stats']
@ -78,6 +79,8 @@ class JobState:
f"Job State Changed - Prev State: {old_state}, "
f"New State: {new_state}"
)
if new_state == "cancelled":
await kapis.run_gcode("_CANCEL_PRINT_BASE")
# NOTE: Individual job_state events are DEPRECATED. New modules
# should register handlers for "job_state: status_changed" and
# match against the JobEvent object provided.