From 7050c71524fa0891b4feace0b363f8e9b30c1e6c Mon Sep 17 00:00:00 2001 From: Austin Mroczek Date: Sun, 7 Mar 2021 09:46:14 -0800 Subject: [PATCH] Round miles in myChevy sensors (#46879) --- homeassistant/components/mychevy/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/mychevy/sensor.py b/homeassistant/components/mychevy/sensor.py index 41311845185..df8b136741a 100644 --- a/homeassistant/components/mychevy/sensor.py +++ b/homeassistant/components/mychevy/sensor.py @@ -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()