Fix spurious 0300_0002 error notification via HMS array path (#583)

The previous fix only filtered status codes (< 0x4000) from the
  print_error field. Firmware can also send the same false positive
  through the hms array in MQTT, which had no such filter. Apply the
  same < 0x4000 check to the HMS parser so status/phase indicators
  are skipped regardless of which MQTT field carries them.
This commit is contained in:
maziggy
2026-03-04 09:26:51 +01:00
parent 19a1a7584b
commit acae51b938
3 changed files with 7 additions and 2 deletions
+5
View File
@@ -1854,6 +1854,11 @@ class BambuMQTTClient:
severity = (attr >> 8) & 0xF
# Module is in attr byte 3 (bits 24-31)
module = (attr >> 24) & 0xFF
# Skip non-error status codes — all real HMS errors
# have code >= 0x4000. Lower values are status/phase
# indicators that some firmware sends during normal printing.
if code < 0x4000:
continue
self.state.hms_errors.append(
HMSError(
code=f"0x{code:x}" if code else "0x0",
@@ -236,7 +236,7 @@ class TestTimelapseTracking:
{
"print": {
"gcode_state": "RUNNING",
"hms": [{"attr": 0x07000002, "code": 0x1234}], # Filament module error
"hms": [{"attr": 0x07000002, "code": 0x8001}], # Filament module error (code must be >= 0x4000)
}
}
)