From 218c82eaf3223f3c7ec8481b62e0755dbe71b692 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Sat, 12 Jan 2019 13:51:01 -0500 Subject: [PATCH] mychevy: Fix wrong attribute on battery level selector (#20016) The battery level sensor is broken because the logic for determining if the battery is charged accessed the wrong variable. This one character fix makes it work again. --- homeassistant/components/sensor/mychevy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/mychevy.py b/homeassistant/components/sensor/mychevy.py index a835321991d..b478e2ef3ca 100644 --- a/homeassistant/components/sensor/mychevy.py +++ b/homeassistant/components/sensor/mychevy.py @@ -141,7 +141,7 @@ class EVSensor(Entity): 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