mirror of
https://github.com/OMGeeky/homecontrol.esp-sensors.git
synced 2026-01-08 04:21:00 +01:00
fix: ensure topic and message are hashable in callback by converting to bytes
This commit is contained in:
@@ -562,7 +562,8 @@ class MQTTClient:
|
||||
# Call the callback if set
|
||||
if self.callback:
|
||||
try:
|
||||
self.callback(topic, message)
|
||||
# Convert bytearrays to bytes to ensure they are hashable
|
||||
self.callback(bytes(topic), bytes(message))
|
||||
except Exception as e:
|
||||
print(f"Warning: Callback error: {e}")
|
||||
except struct.error as e:
|
||||
|
||||
Reference in New Issue
Block a user