Cleanup dead code in renault (#132172)

This commit is contained in:
epenet 2024-12-03 14:33:40 +01:00 committed by GitHub
parent af5574f71c
commit 76ba3afeae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View File

@ -18,7 +18,7 @@ from renault_api.kamereon.models import KamereonVehicleDataAttributes
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
T = TypeVar("T", bound=KamereonVehicleDataAttributes | None)
T = TypeVar("T", bound=KamereonVehicleDataAttributes)
# We have potentially 7 coordinators per vehicle
_PARALLEL_SEMAPHORE = asyncio.Semaphore(1)

View File

@ -59,6 +59,4 @@ class RenaultDataEntity(
def _get_data_attr(self, key: str) -> StateType:
"""Return the attribute value from the coordinator data."""
if self.coordinator.data is None:
return None
return cast(StateType, getattr(self.coordinator.data, key))