mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fixing odometer to display km (#13427)
This commit is contained in:
parent
2d2e8034d6
commit
3a765692e7
@ -86,6 +86,8 @@ class TeslaSensor(TeslaDevice, Entity):
|
|||||||
self._unit = LENGTH_MILES
|
self._unit = LENGTH_MILES
|
||||||
else:
|
else:
|
||||||
self._unit = LENGTH_KILOMETERS
|
self._unit = LENGTH_KILOMETERS
|
||||||
|
self.current_value /= 0.621371
|
||||||
|
self.current_value = round(self.current_value, 2)
|
||||||
else:
|
else:
|
||||||
self.current_value = self.tesla_device.get_value()
|
self.current_value = self.tesla_device.get_value()
|
||||||
if self.tesla_device.bin_type == 0x5:
|
if self.tesla_device.bin_type == 0x5:
|
||||||
@ -95,3 +97,5 @@ class TeslaSensor(TeslaDevice, Entity):
|
|||||||
self._unit = LENGTH_MILES
|
self._unit = LENGTH_MILES
|
||||||
else:
|
else:
|
||||||
self._unit = LENGTH_KILOMETERS
|
self._unit = LENGTH_KILOMETERS
|
||||||
|
self.current_value /= 0.621371
|
||||||
|
self.current_value = round(self.current_value, 2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user