Git Product home page Git Product logo

Comments (4)

pszafer avatar pszafer commented on June 3, 2024

I tried it already, but I failed. I haven't had much time to test, but I couldn't make asyncio.Lock to "wait" to be ready.

But imagine:

  • HC1, HC2, DHW1, DHW2 - every 30 secs in single call from HA. It takes about 30 secs to fetch all data. - let's call it fetch1
  • Sensor1: every 60 secs - fetching takes about 5 secs - fetch2
  • Sensor2: every 90 secs - fetching takes about 5 secs - fetch3

If fetch1 is in progress and fetch2 wants to be in progress then it should wait till fetch1 finishes, but it abort instead.
if user change mode or do something then this call won't be blocked.
If I have one timer then at least I'm sure that there is maximum 2 simultaneous calls to gateway.
If I put more times then I can have multiple simultaneous calls and it might be worse than it is right now.

from home-assistant-bosch-custom-component.

Trefex avatar Trefex commented on June 3, 2024

Does something like this help at all?

https://www.artificialworlds.net/blog/2017/05/31/python-3-large-numbers-of-tasks-with-limited-concurrency/

I am not deep into HASS dev (barely touching the surface) as I just recently started.

from home-assistant-bosch-custom-component.

pszafer avatar pszafer commented on June 3, 2024

Maybe it's worth a try. I'll check it out

from home-assistant-bosch-custom-component.

pszafer avatar pszafer commented on June 3, 2024

Sorry, I don't know how to implement it in a way working with home assistant helpers. If you are willing to make PR, we can give it another shot.

from home-assistant-bosch-custom-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.