From 593e44fd149ee8333b95c0b2afb4e31b35cffa39 Mon Sep 17 00:00:00 2001 From: Josef-MrBeam Date: Tue, 24 Oct 2023 11:50:09 +0200 Subject: [PATCH] link received errors to correct notification id --- octoprint_mrbeam/iobeam/iobeam_handler.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/octoprint_mrbeam/iobeam/iobeam_handler.py b/octoprint_mrbeam/iobeam/iobeam_handler.py index 2e730d8c4..e21d5ce32 100644 --- a/octoprint_mrbeam/iobeam/iobeam_handler.py +++ b/octoprint_mrbeam/iobeam/iobeam_handler.py @@ -1215,8 +1215,15 @@ def _handle_error_message(self, message): MrBeamEvents.HARDWARE_MALFUNCTION, dict(data=message), ) + if ( + message.get("id") + and message.get("id") in HwMalfunctionHandler.KNOWN_MALFUNCTIONS + ): + notification_id = message.get("id") + else: + notification_id = HwMalfunctionHandler.HARDWARE_MALFUNCTION_NON_I2C notification = self._user_notification_system.get_notification( - notification_id=HwMalfunctionHandler.HARDWARE_MALFUNCTION_NON_I2C, + notification_id=notification_id, err_code=malfunction.error_code, replay=True, )