From e191af24611629bdffb751e4f480bd2cffbe0524 Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 4 Feb 2024 03:24:26 +0000 Subject: [PATCH] Bugfix select classes --- custom_components/teslemetry/select.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/teslemetry/select.py b/custom_components/teslemetry/select.py index 80b8edb..ec41720 100644 --- a/custom_components/teslemetry/select.py +++ b/custom_components/teslemetry/select.py @@ -89,7 +89,7 @@ def current_option(self) -> str | None: return self.get() -class TeslemetrySeatHeaterSelectEntity(TeslemetryVehicleEntity, TeslemetrySelectEntity): +class TeslemetrySeatHeaterSelectEntity(TeslemetrySelectEntity, TeslemetryVehicleEntity): """Select entity for vehicle seat heater.""" _attr_options = [ @@ -104,6 +104,7 @@ def __init__(self, vehicle, key, scoped: bool) -> None: super().__init__(vehicle, key) self.scoped = scoped + @property def current_option(self) -> str | None: """Return the current selected option.""" @@ -119,7 +120,8 @@ async def async_select_option(self, option: str) -> None: class TeslemetryEnergySiteSelectEntity( - TeslemetryEnergyInfoEntity, TeslemetrySelectEntity + TeslemetrySelectEntity, + TeslemetryEnergyInfoEntity ): """Select entity for energy sites.""" @@ -127,7 +129,7 @@ def __init__( self, vehicle, description: TeslemetrySelectEntityDescription, scoped: bool ) -> None: """Initialize the operation mode select entity.""" - super().__init__(vehicle, "default_real_mode") + super().__init__(vehicle, description.key) self.scoped = scoped self.entity_description = description