benleb / surepy

🐾 Library & CLI to monitor and control the Pet Door & Cat Flap Connect 🚪 the Pet Feeder Connect 🍽 and the Felaqua 💦 sold by Sure Petcare
https://pypi.org/project/surepy/
MIT License
76 stars 36 forks source link

Longer tokens are not supported #203

Closed botterli closed 8 months ago

botterli commented 8 months ago

Hello,

I fetched a new token today, and it was 491 characters long. This is longer than token_seems_valid() accepts, so it was rejected. After editing the function to allow tokens of length up to 500 I was able to authenticate and use surepy as normal. I would add a PR, but I have no idea what is considered an acceptable length.

Thanks for making this module!

MechEng70 commented 8 months ago

@botterli did you change line 71 of client.py?

botterli commented 8 months ago

@MechEng70 Yes, that is correct

MechEng70 commented 8 months ago

@botterli How did you edit that file? in my custom components, I have the sureha and not the surepy.

botterli commented 8 months ago

I simply replaced ‎448 with 500.

MechEng70 commented 8 months ago

I am having issues finding the file. Do you have this as a custom component? If not, did you SSH into your HA and locate the file?

botterli commented 8 months ago

I'm not using HA, but my custom system to integrate this module. I don't know anything about HA, I'm afraid

benleb commented 8 months ago

sorry - limit removed 👍 https://github.com/benleb/surepy/commit/980678524efe57ae7935417dd11578b94751afa4

MechEng70 commented 8 months ago

@benleb I realize that this closed (and thank you for fixing it). Tactical question, how does this get pulling into SureHA on HA? Do we need to wait for the latest update?

benleb commented 8 months ago

I will do a new release probably tomorrow (and maybe merge some other MRs before 👍 ) :)