fix enum entities
This commit is contained in:
1 parent
542f244a28
commit
15a890fb7d
1 file changed
+1
-4
@@ -171,16 +171,13 @@ class BluettiSensor(CoordinatorEntity, SensorEntity):
|
|||||||
|
|
||||||
self._attr_available = True
|
self._attr_available = True
|
||||||
|
|
||||||
_LOGGER.error(response_data)
|
|
||||||
|
|
||||||
# Different for enum and numeric
|
# Different for enum and numeric
|
||||||
if (
|
if (
|
||||||
self._options is not None
|
self._options is not None
|
||||||
and isinstance(response_data, Enum)
|
and isinstance(response_data, Enum)
|
||||||
and response_data.value < len(self._options)
|
|
||||||
):
|
):
|
||||||
# Enum
|
# Enum
|
||||||
self._attr_native_value = self._options[response_data.value]
|
self._attr_native_value = response_data.name
|
||||||
else:
|
else:
|
||||||
# Numeric
|
# Numeric
|
||||||
self._attr_native_value = response_data
|
self._attr_native_value = response_data
|
||||||
|
|||||||
Reference in new issue
Block a user