mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 15:54:27 +02:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user