Hi,
Since you’ve looked into this issue in depth, I’m curious—what’s the reason for the 10-minute STATUS_UPDATE_INTERVAL? Will a lower interval affect the machines?
I’d like to see faster updates on some topics.
Don’t want to go down a rabbit hole. :)
Thanks!
async def query_status_device(device: Device):
**_STATUS_UPDATE_INTERVAL = 600.0**
_WAIT_FOR_EMPTY_QUEUE = 10.0
while True:
# In case the AC is stuck, and not fetching commands, avoid flooding
# the queue with status updates.
while device.commands_queue.qsize() > 10:
await asyncio.sleep(_WAIT_FOR_EMPTY_QUEUE)
device.queue_status()
await asyncio.sleep(_STATUS_UPDATE_INTERVAL)