eifinger / hass-weenect

Homeassistant integration for weenect
MIT License
11 stars 3 forks source link

Update intervals #367

Closed andreasbrett closed 7 months ago

andreasbrett commented 7 months ago

Once again changing intervals after having debugged the Weenect API and current app (Android and mobile web app). I can't tell though if there are different intervals for dog vs cat vs kid trackers. Furthermore I changed the default setting from 30M to 10M since that is the max. official interval and will show in the Android app' s UI.

Intervals that can be set through the apps: 0S/30S/1M/2M/3M/5M/10M

Intervals the API accepts: 0S-99S or 0M-99M.

It is not possible to set hours (e.g. 1H). I wasn't able to test if the tracker itself respects non official intervals (e.g. 13M, 60M, 99S) and would actually send the GPS signal at a non-official ("custom") interval. They are stored though server-side for the tracker and displayed in the mobile web app (since there is no slider to set the interval but rather a text display of the setting).

Furthermore I added battery life information from the mobile web app.

image image image image image image

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.20%. Comparing base (d53802c) to head (1214548).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #367 +/- ## ======================================= Coverage 98.20% 98.20% ======================================= Files 20 20 Lines 668 668 ======================================= Hits 656 656 Misses 12 12 ``` | [Flag](https://app.codecov.io/gh/eifinger/hass-weenect/pull/367/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/eifinger/hass-weenect/pull/367/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger) | `98.20% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

eifinger commented 7 months ago

I developed this by looking at the requests the web app makes in chrome dev-tools and verified it with the app. By now I do not use the tracker anymore. Maybe they changed the app and the tracker firmware. I am in favor of aligning with the app.

If we send update intervals not supported by the app, but the backend accepts it, it could still confuse the firmware on the tracker if they forgot to properly clean the data.