Andre0512 / pyhOn

Control hOn devices with python
MIT License
470 stars 1.76k forks source link

Update for new hOn login #29

Closed addshore closed 3 months ago

addshore commented 4 months ago

https://github.com/Andre0512/hon/issues/230

It looks like the first URL gives us a different URL back, that is also relative. This URL takes us to a NEW login page, so I force us back to the old one for now. It also looks like there used to be more redirects, and now there are less?

Anyway, this code should work for both the OLD and NEW auth methods as far as I can tell

addshore commented 4 months ago

Tested using my login and the example in the docs to list my appliances, and it correctly lists my refrigerator

zawadzkipiter commented 4 months ago

wow this works! @addshore You are our hero!

addshore commented 4 months ago

wow this works! @addshore You are our hero!

Any idea how to fold this into a working HA integration? :D

edmund-1 commented 4 months ago

Interesting, anyone can approve, but needs special permissions to merge to base branch. Not sure if @Andre0512 added anyone except him with merge permissions.

addshore commented 4 months ago

Let's hope @Andre0512 makes an appearance in that case!

roelofz commented 4 months ago

I also experienced problems today with the HON integration. I read here about pyhon, but I don't know what to do with it. I'm running HA in a container, so maybe this is not a solution for me. If it is, how to enable / install this?

addshore commented 4 months ago

@roelofz take a look at https://github.com/Andre0512/hon/issues/230

roelofz commented 4 months ago

So I need to wait untill https://github.com/Andre0512/hon/ has updated his package, the link describes the issue, but I am not able to see what code needs to be modified on what place. Too difficult for (am not a coder, so maybe noob behaviour)...

DavidMW38 commented 4 months ago

So I need to wait untill https://github.com/Andre0512/hon/ has updated his package, the link describes the issue, but I am not able to see what code needs to be modified on what place. Too difficult for (am not a coder, so maybe noob behaviour)...

So, I was struggling with this too, my system wouldn't let me use this fork (HACS said the repo wasn't configured correctly), and couldn't find PyhOn-0.17.5 for some reason (only 0.17.4). But I solved the issue by deleting my HOn config and integration, removing the HOn HACS download, restarting HA, then installing this version (available in HACS too) instead (https://github.com/gvigroux/hon.git), restarting HA one more time and then adding the HOn integration to HA. My login details worked first time, and my devices and entities work again 🥳

roelofz commented 4 months ago

It works! Thanks mate!

DavidMW38 commented 4 months ago

It works! Thanks mate!

No worries 👍 Glad it worked for you too.

I don't know why my system said PyhOn-0.17.5 doesn't exist, or why I couldn't convince it to use this repository (even a downloaded & unzipped version of it), but swapping to this integration works so I'm happy again ☺️

...Now, if only solving the Smart Life/Tuya integration auth problem (that has "apparently" already been fixed 🤷‍♂️) was so easy 😮‍💨 lol

roelofz commented 4 months ago

I have no idea how to install Pyhon, nor do I know if it is installed. I only removed the old package and installed the new one, with restarts in between.

Borty97 commented 3 months ago

I approved it. I do not know if someone else needs to approve it too (I supose). Hope I helped

Andre0512 commented 3 months ago

Thanks for your work! Sorry for the late response...

addshore commented 3 months ago

Thanks for your work! Sorry for the late response...

Haha, no problem :) Thanks for reappearing!