Closed nitaybz closed 3 years ago
Hey! The session length/management is down to the configuration of the powermanage service you're connecting to. I personally reauth on every request. It's a balance really, you could figure how long the session lasts and keep it for that long but you'd need to catch the failure of the powermanage service flushing their sessions. So I'd say if you don't want to reauth every time then maybe keep the session but catch the fail then reauth then retry your request?
My implementation https://github.com/chrisns/visonic_v8_awsiot
So there is no chance to get blocked at some point by authorizing on each request?
well, thats up to who runs the powermanage service you're connecting to, this is all based on others efforts to reverse engineer the visonic go mobile app. so normal slopey shoulder advice of refer to your agreements and what not with who provides your powermanage service, you're going to cause more traffic than they'd be normally used to.
Personally I've been reauthing on every request, with at least one request every minute for the past few years.
Closing, please feel free to PR the readme with a link to your homebridge integration! Thanks
Hey... This library looks amazing and works pretty good for me on testings... I would want to use this library to control the alarm system in HomeKit via Homebridge. While investigating the code I tried to figure out what would be the best way to implement this library in my plugin. I found out that while we keep reusing the "authenticatedAxios", we are actually using the first token and session id that we extracted... I was wondering if those should expire after some time or are they permanent? should I recall "getAuthenticatedAxios" after some time to refresh token and session id? or maybe the token is valid forever but only the session id should be refreshed?
anyway I think those should be handled inside the library, the "getAuthenticatedAxios" client should check for the expiration date of the session id and get a new one if it is expired before getting new status or other methods.
Let me know your thoughts, Thanks