diff --git a/homeassistant/components/sensor/mychevy.py b/homeassistant/components/sensor/mychevy.py index a835321991d94..b478e2ef3ca7d 100644 --- a/homeassistant/components/sensor/mychevy.py +++ b/homeassistant/components/sensor/mychevy.py @@ -141,7 +141,7 @@ def _car(self): def icon(self): """Return the icon.""" if self._attr == BATTERY_SENSOR: - charging = self.state_attributes.get("charging", False) + charging = self._state_attributes.get("charging", False) return icon_for_battery_level(self.state, charging) return self._icon