Fix powerwall 0% in Tessie and Tesla Fleet (#140017)

Fix powerwall zero
This commit is contained in:
Brett Adams 2025-03-07 17:45:25 +10:00 committed by Franck Nijhof
parent 9f94ee280a
commit 5e26d98bdf
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 2 additions and 1 deletions

View File

@ -466,6 +466,7 @@ async def async_setup_entry(
for energysite in entry.runtime_data.energysites
for description in ENERGY_LIVE_DESCRIPTIONS
if description.key in energysite.live_coordinator.data
or description.key == "percentage_charged"
),
( # Add energy site history
TeslaFleetEnergyHistorySensorEntity(energysite, description)

View File

@ -397,6 +397,7 @@ async def async_setup_entry(
for energysite in entry.runtime_data.energysites
for description in ENERGY_LIVE_DESCRIPTIONS
if description.key in energysite.live_coordinator.data
or description.key == "percentage_charged"
),
( # Add wall connectors
TessieWallConnectorSensorEntity(energysite, din, description)
@ -449,7 +450,6 @@ class TessieEnergyLiveSensorEntity(TessieEnergyEntity, SensorEntity):
def _async_update_attrs(self) -> None:
"""Update the attributes of the sensor."""
self._attr_available = self._value is not None
self._attr_native_value = self.entity_description.value_fn(self._value)