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.
This commit is contained in:
Sean Dague 2019-01-12 13:51:01 -05:00 committed by GitHub
parent 22c0733d8e
commit 218c82eaf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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