Skip to content

Commit

Permalink
fix: always show charge energy for current and last session (#414)
Browse files Browse the repository at this point in the history
Fixes #295 and #413
  • Loading branch information
carleeno committed Dec 9, 2022
1 parent 01116d1 commit be6c1f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/tesla_custom/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def __init__(
@property
def native_value(self) -> float:
"""Return the charge energy added."""
if self._car.charging_state == "Charging":
return self._car.charge_energy_added
return "0"
# The car will reset this to 0 automatically when charger
# goes from disconnected to connected
return self._car.charge_energy_added

@property
def extra_state_attributes(self):
Expand Down

0 comments on commit be6c1f0

Please sign in to comment.