eifinger / hass-weenect

Homeassistant integration for weenect
MIT License
6 stars 2 forks source link

feat: add extra attributes to device_tracker #371

Closed andreasbrett closed 4 months ago

andreasbrett commented 4 months ago

Add 4 extra attributes to device tracker:

Speed and course should be quite valuable since it allows HA to determine the direction of travel and speed. I'm not perfectly sure these are used for the Proximity integration or if that is derived from the GPS location history. Since the HA mobile app is providing both attributes though and proximity sensors work very well with them, we should pass those attributes on from the Weenect API to HA.

PDOP and confidence on the other hand are for advanced users that want to dig deeper into GSM signal details. Basically they provide more detail on the GPS accuracy (when "number of GPS satellites" just isn't enough). I don't think it hurts to expose them via extra attributes. I didn't see them important enough to make dedicated sensors out of them though.

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 98.06%. Comparing base (ac1cf1a) to head (554bec0). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #371 +/- ## ========================================== - Coverage 98.20% 98.06% -0.14% ========================================== Files 20 20 Lines 668 777 +109 ========================================== + Hits 656 762 +106 - Misses 12 15 +3 ``` | [Flag](https://app.codecov.io/gh/eifinger/hass-weenect/pull/371/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/371/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kevin+Eifinger) | `98.06% <100.00%> (-0.14%)` | :arrow_down: | 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 4 months ago

I saw you picked up on the naming scheme. I went for https://www.conventionalcommits.org/en/v1.0.0/ in this repo. In newer repos I do like https://github.com/release-drafter/release-drafter more but its a personal choice.

andreasbrett commented 4 months ago

Added tests. While testing I could not get a confidence value in the API responses, so I removed it from this PR for now. I thought I had seen confidence values from the responses though. Might be my sickness atm though. If I pick up confidence in the near future I will raise another PR.