Skip to content

Commit

Permalink
mychevy: Fix wrong attribute on battery level selector (home-assistan…
Browse files Browse the repository at this point in the history
…t#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.
  • Loading branch information
sdague authored Jan 12, 2019
1 parent 22c0733 commit 218c82e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion homeassistant/components/sensor/mychevy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 218c82e

Please sign in to comment.