Skip to content

What happens if I decrease the STATUS_UPDATE_INTERVAL to a lower value? #313

@covrig

Description

@covrig

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions