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:
Mortdecai
2026-10-23 00:28:00 -04:00
parent df0ae875de
commit f7422c9d74
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -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}")