dan-r / HomeAssistant-NissanConnect

Unofficial Home Assistant integration for interacting with Nissan Connect vehicles 🚗
MIT License
45 stars 12 forks source link

Changing Imperial units doesn't seem to change anything #61

Closed reedy closed 1 month ago

reedy commented 1 month ago

What happened? Add a car, don't select imperial units initially

To Reproduce Re-configure car to use imperial units after initially setting to not use imperial units

Expected behavior

Either by default after changing to imperial, or at least after a reload (fairly common thing to have to do in HA)/refresh of data, the units should change from KM to miles.

Deleting and re-adding with imperial selected (https://github.com/dan-r/HomeAssistant-NissanConnect/pull/60 to make it more obvious to others too!) did set the car up again with imperial units...

Log Output

Home Assistant Version 2024.10.3

Integration Version v0.5.6

Additional context

reedy commented 1 month ago

Screenshot 2024-10-24 at 01 19 12

Though it does seem to have confused some of the graphs a bit..

dan-r commented 1 month ago

So the native unit of all measurements is metric, as this is what the Nissan API returns. By default, Home Assistant will convert the units and show in the unit for your locale/configuration.

The only reason this box exists is for countries like (maybe only) the UK who mostly use metric, except for a few exceptions like miles. As a result the only thing it changes is that is suggests to Home Assistant to use different units.

Because of this behaviour I may just remove the checkbox from the configure screen, but keep it on the initial setup screen. Even without this box you can click into each entity and change it manually and it'll convert everything for you.

image