Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix to always use json when sending a PUT/POST #201

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Fix to always use json when sending a PUT/POST #201

merged 1 commit into from
Dec 18, 2023

Conversation

ashleigh-hopkins
Copy link
Contributor

@ashleigh-hopkins ashleigh-hopkins commented Dec 13, 2023

Disclaimer, I've never written any python before... and I didn't test that any command and control actions work 😅

Should fix #199

@benleb benleb mentioned this pull request Dec 14, 2023
@benleb
Copy link
Owner

benleb commented Dec 14, 2023

oh hey :D thanks you! looks good on first view, will check it tomorrow and merge :)

great to get a contribution from you! 🙌 😄

@dieriver
Copy link

I have tested this fix, and it seems it works. At least the PUT queries now work (specifically, u tried using the client._set_lock_state function, and the server can handle it correctly.

@jdrews
Copy link

jdrews commented Dec 17, 2023

I have also tested this branch and can confirm that it restores API connectivity. On the v0.9.0a0 release I get a "[415 Unsupported Media Type]" and DENY back from surehub.io. With this PR I am able to perform queries to the surehub.io API again.

@benleb benleb merged commit dcb7846 into benleb:dev Dec 18, 2023
1 check passed
@ivo-toby
Copy link

I replaced the lib in my Home-assistant install and it works like a charm! Just in time for new-years so I can keep the cats indoors while I'm abroad.. Thanks a lot!

@blair287
Copy link

I replaced the lib in my Home-assistant install and it works like a charm! Just in time for new-years so I can keep the cats indoors while I'm abroad.. Thanks a lot!

How do you do that please?

@ivo-toby
Copy link

I replaced the lib in my Home-assistant install and it works like a charm! Just in time for new-years so I can keep the cats indoors while I'm abroad.. Thanks a lot!

How do you do that please?

Depends on your setup, ymmv.
I am running HassOS (in proxmox) with the advanced SSH plugin. I don't upgrade Home-assistant that often, so I am not on the latest version!

So what I did:

  • ssh'ed to the instance
  • list all running containers with docker ps and searched for the ghcr.io/home-assistant/qemux86-64-homeassistant container.
  • got shell with docker exec -it [container-id] bash
  • cloned this repo into /root
  • search for the location of surepy with pip show surepy, on my setup it was in /usr/local/lib/python3.11/site-package/surepy
  • replaced /usr/local/lib/python3.11/site-package/surepy with the one in /root/surepy/surepy

That should do the trick. I do recommend backing up the original surepy folder in /usr/local/lib/python3.11/site-package/. Also; if you update Home-assistant and the fixes has not been merged you will need to do this again.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

having issues logging in
6 participants