Feller-AG / wiser-api

MIT License
12 stars 1 forks source link

Multiple Request #19

Closed hansfriedrich closed 2 years ago

hansfriedrich commented 2 years ago

Im currently developing a home bridge plugin utilizing the wiser api. I'm facing the issue that the request are fulfilled too slowly within concurrent requests. Is there any suggestion how many concurrent requests should be made?

woodworm commented 2 years ago

14 parallel requests should not be a problem. How often do you make a request? Which request is it about?

hansfriedrich commented 2 years ago

thank you so much for your answer. My plugin used to request every single load (GET /api/loads/{id}/state)on startup for status update. In my setting there are around 20 of them resulting in a warning of the Homebridge platform that this lasts too long.

A short time before my question the doc regrading the websocket was published. I think this is the way better approach.

woodworm commented 2 years ago

It would probably be more efficient if you read all state with one service GET /api/loads/state. Yes, indeed... so that you don't have to poll the state all the time, websocket is surely the better solution 👌👍️.