mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix Reson sensor enum options mapping (#101380)
This commit is contained in:
parent
83c5844c2e
commit
5edcd7ef0f
@ -51,16 +51,6 @@ from .const import DOMAIN
|
|||||||
from .coordinator import RensonCoordinator
|
from .coordinator import RensonCoordinator
|
||||||
from .entity import RensonEntity
|
from .entity import RensonEntity
|
||||||
|
|
||||||
OPTIONS_MAPPING = {
|
|
||||||
"Off": "off",
|
|
||||||
"Level1": "level1",
|
|
||||||
"Level2": "level2",
|
|
||||||
"Level3": "level3",
|
|
||||||
"Level4": "level4",
|
|
||||||
"Breeze": "breeze",
|
|
||||||
"Holiday": "holiday",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class RensonSensorEntityDescriptionMixin:
|
class RensonSensorEntityDescriptionMixin:
|
||||||
@ -294,9 +284,9 @@ class RensonSensor(RensonEntity, SensorEntity):
|
|||||||
if self.raw_format:
|
if self.raw_format:
|
||||||
self._attr_native_value = value
|
self._attr_native_value = value
|
||||||
elif self.entity_description.device_class == SensorDeviceClass.ENUM:
|
elif self.entity_description.device_class == SensorDeviceClass.ENUM:
|
||||||
self._attr_native_value = OPTIONS_MAPPING.get(
|
self._attr_native_value = self.api.parse_value(
|
||||||
self.api.parse_value(value, self.data_type), None
|
value, self.data_type
|
||||||
)
|
).lower()
|
||||||
else:
|
else:
|
||||||
self._attr_native_value = self.api.parse_value(value, self.data_type)
|
self._attr_native_value = self.api.parse_value(value, self.data_type)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user