shauntarves / wyze-sdk

A modern Python client for controlling Wyze devices.
The Unlicense
313 stars 49 forks source link

Is this line correct? #161

Closed harwalan closed 10 months ago

harwalan commented 11 months ago

This line looks potentially like a copy/paste error. Can you confirm this is right? (it doesn't work). It's the 3rd method in the list that calls this API url.

return self.api_call('/plugin/scale/get_latest_record', json=kwargs)

https://github.com/shauntarves/wyze-sdk/blob/24f422f8d1f3ff9ce8065071519eed391e4e7b24/wyze_sdk/service/scale_service.py#L195C45-L195C62

shauntarves commented 10 months ago

Oh, that's definitely a copy/paste error. Are you actually trying to use this method!?

harwalan commented 10 months ago

Hey @shauntarves ! Yes, I am trying to use this method.

shauntarves commented 10 months ago

@harwalan Try changing /plugin/scale/get_latest_record to /plugin/scale/add_record. It looks like that endpoint may expect a timezone to be specified as well, but give it a shot and see if the new record saves and has the correct day/time

harwalan commented 10 months ago

@shauntarves I made that url change locally and it works. Thanks!

shauntarves commented 10 months ago

Cool - I'll make a patch for it shortly and get a new version released. Thanks for reporting!