Skip to content

Commit

Permalink
Fix bug in walrus logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Nov 11, 2024
1 parent e466b55 commit 8dacd98
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/teslemetry/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,13 +1171,12 @@ def _async_update_attrs(self) -> None:
self._attr_available = False
self._attr_native_value = None


def _async_value_from_stream(self, value) -> None:
"""Update the value of the entity."""
self._attr_available = True
if value := auto_type(value) is not None:
self._attr_native_value = self.entity_description.value_fn(value)

if (value := auto_type(value)) is not None:
self._attr_available = True
self._attr_native_value = self.entity_description.value_fn(value)

class TeslemetryVehicleTimeSensorEntity(TeslemetryVehicleEntity, SensorEntity):
"""Base class for Teslemetry vehicle metric sensors."""
Expand Down

0 comments on commit 8dacd98

Please sign in to comment.