fire and forget setDry
This commit is contained in:
@@ -3085,13 +3085,10 @@ class KobraXBridge:
|
|||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
def _send():
|
def _send():
|
||||||
return self.client.publish("multiColorBox", "setDry", payload, timeout=5)
|
return self.client.publish("multiColorBox", "setDry", payload, timeout=0)
|
||||||
|
# Fire-and-forget: setDry ACK arrives via multiColorBox/report callback.
|
||||||
resp = await loop.run_in_executor(None, _send)
|
# Waiting for a response on that busy push topic causes false "code:0" rejections.
|
||||||
if resp is None:
|
await loop.run_in_executor(None, _send)
|
||||||
return web.json_response({"error": "No response from printer"}, status=504)
|
|
||||||
if int(resp.get("code", 200)) != 200:
|
|
||||||
return web.json_response({"error": f"Printer rejected command: {resp}"}, status=502)
|
|
||||||
|
|
||||||
self._state["ace_drying"] = ui_state
|
self._state["ace_drying"] = ui_state
|
||||||
self._state_dirty = True
|
self._state_dirty = True
|
||||||
|
|||||||
Reference in New Issue
Block a user