RobertD502 / home-assistant-petkit

Home Assistant integration for PetKit devices
MIT License
184 stars 28 forks source link

Avatar URLs #47

Closed willliamchan closed 10 months ago

willliamchan commented 10 months ago

Hi there

Thank you so much for making this and this is something that I've been waiting for so long!

Just a quick question about my pet's avatar, is it possible to script the avatar to use https instead of http?

I am getting this and I tried to add http(s) and the picture loads too.

image

On the other hand, is there a way to keep weight history? The value seems reset every once in a while, and I'd like to always know what is the last measured weight of my cats.

RobertD502 commented 10 months ago

Can't use https. Petkit's API uses http.

Regarding weight - the next update will include a method to retain weight measurements if a particular day hasn't had any litter box usage yet.

willliamchan commented 10 months ago

Can't use https. Petkit's API uses http.

Regarding weight - the next update will include a method to retain weight measurements if a particular day hasn't had any litter box usage yet.

Oh man. I wasn't expecting a reply so quickly!

Yes I think I got the point about their API not using https, but is there a way we can fetch the URL and tweak the url to replace http with https?

Before I sent the enquiry, I tried and the link checked out.

image

I hope this make sense.

RobertD502 commented 10 months ago

Easiest way to check is to take the url and replace it with https - if you can fetch the image from your browser with https then it is possible. However, I know that using the API itself (controlling devices) won't work with https as I've tried.

You can also ignore the chrome console error if it isn't causing issues in Home Assistant since it seems that Chrome is already converting the http link and fetching it via https and just logging a warning in the console.

willliamchan commented 10 months ago

Understood. Thank you!