Round miles in myChevy sensors (#46879)
This commit is contained in:
parent
d3bd2378ba
commit
7050c71524
1 changed files with 2 additions and 0 deletions
|
@ -160,6 +160,8 @@ class EVSensor(Entity):
|
|||
"""Update state."""
|
||||
if self._car is not None:
|
||||
self._state = getattr(self._car, self._attr, None)
|
||||
if self._unit_of_measurement == "miles":
|
||||
self._state = round(self._state)
|
||||
for attr in self._extra_attrs:
|
||||
self._state_attributes[attr] = getattr(self._car, attr)
|
||||
self.async_write_ha_state()
|
||||
|
|
Loading…
Add table
Reference in a new issue