basnijholt / miflora

☘️🌑🌼πŸ₯€πŸ‘ Mi Flora Plant sensor Python package
MIT License
362 stars 99 forks source link

timeout for not reachable sensors #169

Open Rello opened 2 years ago

Rello commented 2 years ago

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!