diff --git a/CHANGELOG.md b/CHANGELOG.md index 76a148ebc..fb148aac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to Bambuddy will be documented in this file. ## [0.2.1b3] - Unreleased +### Fixed +- **Developer Mode Detection Always Reports Null** — The MQTT `fun` field is an integer in the JSON payload, but the parser used `int(value, 16)` which requires a string argument. This raised `TypeError` on every message, silently caught by the exception handler, so `developer_mode` was never set. Now handles both integer and hex string formats. + ## [0.2.1b2] - 2026-02-21 ### Fixed diff --git a/backend/app/services/bambu_mqtt.py b/backend/app/services/bambu_mqtt.py index 28fccafd6..77e5bfd48 100644 --- a/backend/app/services/bambu_mqtt.py +++ b/backend/app/services/bambu_mqtt.py @@ -2058,7 +2058,8 @@ class BambuMQTTClient: # Parse developer LAN mode from "fun" field if "fun" in data: try: - fun_int = int(data["fun"], 16) + fun_val = data["fun"] + fun_int = fun_val if isinstance(fun_val, int) else int(fun_val, 16) self.state.developer_mode = (fun_int & 0x20000000) == 0 except (ValueError, TypeError): pass