fix: survive command exceptions; TV DHCP-reserved so pairing key stays valid
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,15 @@ def on_connect(client, userdata, flags, rc):
|
||||
|
||||
|
||||
def on_message(client, userdata, msg):
|
||||
# An exception escaping a paho callback kills the network thread while the
|
||||
# poll loop keeps the process alive — a silent zombie systemd never restarts.
|
||||
try:
|
||||
handle_command(client, msg)
|
||||
except Exception:
|
||||
log.exception("command handling failed")
|
||||
|
||||
|
||||
def handle_command(client, msg):
|
||||
command = msg.payload.decode().strip().upper()
|
||||
log.info(f"Received command: {command}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user