Skip to content

Commit

Permalink
Merge pull request #883 from alandtse/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse authored Mar 6, 2024
2 parents 895a207 + 83a5c72 commit 0ebd9ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/tesla_custom/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ class TeslaCarChargerPower(TeslaCarEntity, SensorEntity):
@property
def native_value(self) -> float:
"""Return the charger power."""
return float(self._car.charger_power)
return (
float(self._car.charger_power)
if self._car.charger_power is not None
else self._car.charger_power
)

@property
def extra_state_attributes(self):
Expand Down

0 comments on commit 0ebd9ad

Please sign in to comment.