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