robinostlund / homeassistant-volkswagencarnet

Volkswagen Carnet Component for home assistant
GNU General Public License v3.0
328 stars 60 forks source link

[BUG] km to miles conversion not functioning for odometer and range #647

Closed mkeegan closed 1 month ago

mkeegan commented 3 months ago

Before you post a new issue - you must first check the following (and check the boxes with an "X" below)

Environment

Describe the bug

Steps to Reproduce

Configure integration for km to mil.

Expected behavior

Integration is configured for km to mil. Sensors should show range and odometer values in miles but these are incorrect. When converted it is actually kilometers.

Screenshots

Screenshot 2024-07-08 at 21 21 14 Screenshot 2024-07-08 at 21 21 02 Screenshot 2024-07-08 at 21 20 55

Traceback/Error logs

n/a

Debug information - all JSON responses from logfile

Additional context

I've attempted to toggle the configuration values to No conversion and then back to km to mil but this didn't have an a

Note

Issues lacking sufficient details or context may be subject to closure without prior notice. Detailed bug reports are essential for effective issue resolution. Thank you for your cooperation.

stickpin commented 2 months ago

@mkeegan you should switch to the "imperial units" if you want to see it converted to miles. "km to mil" is only switching km to mil without any conversation.

I don't know why this option is present. @robinostlund I don't know the history, but do you know the use case for this "km to mil" option? If not, I will deprecate it in the next version, it's quite confusing... :)

mkeegan commented 2 months ago

Thanks, @stickpin ! That's resolved it. Agree with you that it's confusing.

milkboy commented 2 months ago

"Mil" is probably referring to the "Scandinavian mile", which probably makes sense only to Swedes and Norwegians. So it should be the km value divided by 10. At the very least, it should probably be renamed for clarity.

milkboy commented 2 months ago

Oh, and if it's showing the value in km, it's just wrong on all levels :joy:

stickpin commented 2 months ago

@milkboy I was checking the code and old issues, and it seems like there is a use case where VW Backend is returning already converted to miles values, so in this case we need this "rename" function.

But i don't know if this use case is still applicable to the new Backend.

robinostlund commented 2 months ago

@stickpin if i dont remember wrong i implemented this as the response where in mil in the old service. But feel free to remove it if you see that it is not necessary anymore 😊

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.