Dont cache available property in Teslemetry (#143380)

This commit is contained in:
Brett Adams 2025-04-22 20:35:36 +10:00 committed by GitHub
parent fa2ad54d90
commit c52f73269e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 8 deletions

View File

@ -3,7 +3,6 @@
from abc import abstractmethod
from typing import Any
from propcache.api import cached_property
from tesla_fleet_api.const import Scope
from tesla_fleet_api.teslemetry import EnergySite, Vehicle
from teslemetry_stream import Signal
@ -285,7 +284,7 @@ class TeslemetryVehicleStreamEntity(TeslemetryRootEntity):
"""Update the entity with the latest value from the stream."""
raise NotImplementedError
@cached_property
@property
def available(self) -> bool:
"""Return True if entity is available."""
return self.stream.connected

View File

@ -6,7 +6,6 @@ from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime, timedelta
from propcache.api import cached_property
from teslemetry_stream import TeslemetryStreamVehicle
from homeassistant.components.sensor import (
@ -636,11 +635,6 @@ class TeslemetryStreamSensorEntity(TeslemetryVehicleStreamEntity, RestoreSensor)
)
)
@cached_property
def available(self) -> bool:
"""Return True if entity is available."""
return self.stream.connected
def _async_value_from_stream(self, value: StateType) -> None:
"""Update the value of the entity."""
self._attr_native_value = value