@@ -316,6 +316,7 @@ def _OnWsOpenAndKlippyReady(self):
316316 "webhooks" : None ,
317317 "virtual_sdcard" : None ,
318318 "history" : None ,
319+ "gcode_macro _OCTOAPP_STATUS" : None ,
319320 }
320321 })
321322
@@ -403,6 +404,15 @@ def _OnWsNonResponseMessage(self, msg:str):
403404 elif state == "complete" :
404405 self .MoonrakerCompat .OnDone ()
405406 return
407+
408+ # Check for notifications
409+ octoAppStatusContainerObj = self ._GetWsMsgParam (msg , "gcode_macro _OCTOAPP_STATUS" )
410+ if octoAppStatusContainerObj is not None :
411+ # Split text at ~~~ and take the first element (second half is CPU time to make the value change with same message repeated)
412+ gcodeNotification = octoAppStatusContainerObj ["gcode_macro _OCTOAPP_STATUS" ].get ("notify_message" , None )
413+ message = gcodeNotification .split ("~~~" )[0 ] if "~~~" in gcodeNotification else gcodeNotification
414+ if message != "" :
415+ self .MoonrakerCompat .OnCustomNotification (message )
406416
407417 # Report progress. Do this after the others so they will report before a potential progress update.
408418 # Progress updates super frequently (like once a second) so there's plenty of chances.
@@ -912,6 +922,14 @@ def OnPrintPaused(self):
912922 fileName = stats ["filename" ]
913923 self .NotificationHandler .OnPaused (fileName )
914924
925+ # Called the the print is paused.
926+ def OnCustomNotification (self , message ):
927+ # Only process notifications when ready, aka after state sync.
928+ if self .IsReadyToProcessNotifications is False :
929+ return
930+
931+ self .NotificationHandler .OnCustomNotification (message )
932+
915933
916934 # Called the the print is resumed.
917935 def OnPrintResumed (self ):
0 commit comments