Coder Social home page Coder Social logo

Comments (4)

phenotypic avatar phenotypic commented on September 9, 2024

@mariusz2108 I agree that this is quite inefficient; however, implementing this isn't straight forward due to the way HomeKit requests information.

The way I can see around it is for there to be a central function called something like getStatus which will do the one request; then, when a variable is requested e.g. getTargetTemperature, it asks the getStatus function for this info rather than requesting it directly from the thermostat. However, the central function must ensure that the info is up-to-date.

Like I said, I agree that this would be an improvement and I'm interested in looking into implementing this into my fork of the plugin in the near future then creating a pull request into the main branch.

Best, Tom

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

I also agree, but according on how you will ask SIRI/Home App information, you will still have 4 Calls. Indeed, we can separate the call to get a lighter payload, but at the time I did the plugin, I didn't saw much difference.

And then I think about all the peoplle the have a working API that could be broken with a new implementation.

Do you think this is really an issue ?

@Tommrodrigues, if you do a PullRequest (what can be nice) I will wrap it into a new version. V1.X.X

Thx

from homebridge-thermostat.

mariusz2108 avatar mariusz2108 commented on September 9, 2024

I have made POC with "caching" results and it makes huge difference for me (my home bridge runs on raspberry pi).
First request gets data and save it.
Then I start timer for one minut.
Sice now for one minute every request is taken from "cache".

I am not sure if it's good solution since I don't know well JS. But it works.

from homebridge-thermostat.

PJCzx avatar PJCzx commented on September 9, 2024

from homebridge-thermostat.

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.