miflora icon indicating copy to clipboard operation
miflora copied to clipboard

timeout for not reachable sensors

Open Rello opened this issue 3 years ago β€’ 0 comments

Hello, thank you for your library!

I am looping several sensors and try to poll them

poller = MiFloraPoller(options["mac"], BluepyBackend)
try:
        value=(poller.parameter_value(MI_MOISTURE))
        battery=(poller.parameter_value(MI_BATTERY))
except Exception:
        continue

when a sensor is not available, it takes pretty long until the loop gets the next one. Is there a possibility to define a timeout to shorten this?

I found cache_timeout in the poller, but this seems to be doing something else.

Thank you very much!

Rello avatar Jan 17 '22 12:01 Rello