nirnachmani / Pixie-Plus-for-Home-Assistant

a Pixie Plus integration for Home Assistant
Apache License 2.0
9 stars 3 forks source link

adapt for apparent new API version #7

Closed brendanmckenzie closed 4 months ago

brendanmckenzie commented 1 year ago

I had to make some changes to make it work with the API that I was seeing.

It looks like they changed requests where you passed _method to that associated HTTP request.

nirnachmani commented 1 year ago

Thank you for your work. Can we put this version on another branch? Reason is, I am not sure it will be backwards compatible. The current code works well with my setup and I am not sure if it will work if I use clientkey and the headers. I really don't have time to work on it currently to check. I am also worried that it will break the support for covers and switches.

I wonder why the API is different - we may need code that works for both the old and new API and should have a way to determine which one to use. What version is your gateway?

You obviously also made a lot of changes to make the code more efficient, like passing the 'config' as is and not unnecessarily breaking it down to different variables as I did (you can see I have very limited programing skills), but this also makes it harder for me to see which changes are related to making the code efficient and which changes actually change the way the code works. I will just need more time to look through.

brendanmckenzie commented 1 year ago

You did an outstanding job for someone with "very limited programming skills" !

Absolutely, we can put this on another branch. I just wanted to submit it for reference if someone else comes along.

I'd imagine there are parameters you're passing (like the JS client version) that tell the API to act differently.

Day two and it's still operating perfectly.