Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

update_pet_status fails if pet is in unknown position #8

Open
therefromhere opened this issue Jan 18, 2019 · 2 comments
Open

update_pet_status fails if pet is in unknown position #8

therefromhere opened this issue Jan 18, 2019 · 2 comments

Comments

@therefromhere
Copy link
Contributor

therefromhere commented Jan 18, 2019

First off, great work on this project! A minor bug I've found -

I'm seeing a 204 response from https://app.api.surehub.io/api/pet/<pet_id>/position for a cat that's been added to the catflap but has never gone through it, so they're not showing as either inside or outside in the app.

_get_data doesn't handle 204, so it blows up trying to JSON decode an empty response (with json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)).

The no-code workaround is to explicitly set any newly added pets to a location (eg inside) using the app.

@rcastberg
Copy link
Owner

Thanks, will try to look into this.

@strix-technica
Copy link
Collaborator

@therefromhere this may have been fixed in my recent PR.

I suspect that pet/$id/position was only ever intended (or has since been repurposed) to be for setting the position with a POST. In any event, that endpoint now returns a 405 to a GET, and I've reworked it to get the same info by other means. OTOH, if the animal has never gone through the flap, it may still fail if there is no information to return.

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

No branches or pull requests

3 participants