Prevents crash when called without active connection. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@@ -391,6 +391,10 @@ def get_status_response() -> str:
"""
Send a status query ('?') and return the response if available.
+ if state.conn is None or not state.conn.is_connected():
+ logger.warning("Cannot get status response: no active connection")
+ return False
+
while True:
try:
state.conn.send('?')