Closed leeyuentuen closed 9 months ago
@lucky81, this should possible fix the issue: https://github.com/leeyuentuen/polestar_api/commit/31c424a6748e51c4a47a6c9e79cc54a2b72200c5
see beta 1.5.0
Tested. This is working perfectly - I can now switch units to miles (in Metric mode) in the entity settings. Thank you very much.
Note that as reported elsewhere this change has introduced a bug where Odometer does not initially display (the default unit isn't working), but when I set it to miles is works fine.
i know the issue. i have set the max limit to 1000000. but the meter was over 1m, so that the reason why it isn't showed. i need to set it to a higher limit. but this is a known issue now
Hmmm, I loaded 1.5.0 and I see 3 issues with non-metric. I am getting the odometer "unknown" issue, but you mentioned that above. However, I still see average speed and energy consumption in km, not miles. Energy consumption is not using a native unit, so that one might need special handling. As for average speed, I'm not sure why that didn't convert from meters to miles.
Hmmm, I loaded 1.5.0 and I see 3 issues with non-metric. I am getting the odometer "unknown" issue, but you mentioned that above. However, I still see average speed and energy consumption in km, not miles. Energy consumption is not using a native unit, so that one might need special handling. As for average speed, I'm not sure why that didn't convert from meters to miles.
kw/100km is not an 'official' unit at the moment, so to have them in miles, i think i need to manual convert them.
but this first mr is to be sure that native unit is working on odometer and on the trip distance. if this work fine, then i can see for the next step
This helps for the average_speed polestar_api_diff.txt
This helps for the average_speed polestar_api_diff.txt
you can open mr based from dev
If I select the (range or Odometer) entity, and then go into settings, then I can change 'Unit of Measurement' from 'KM' to 'Mi', but when I save nothing happens... the same action in the Nest integration allows me to switch units - I think this works as it knows that native unit, so can apply the conversion within HA (rather than within your code).
_Originally posted by @lucky81 in https://github.com/leeyuentuen/polestar_api/issues/8#issuecomment-1879732369_