Fix developer mode detection always reporting null

The MQTT "fun" field is an integer in the JSON payload, but the
parser used int(value, 16) which requires a string. This raised
TypeError on every message, silently swallowed by the except clause,
so developer_mode was never set.
This commit is contained in:
maziggy
2026-02-21 16:18:19 +01:00
parent 2ed32ad1e1
commit 257b4748e5
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -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