fix enum entities

This commit is contained in:
Patrick762 committed 2024-03-16 17:49:17 +01:00
1 parent 542f244a28
commit 15a890fb7d
1 file changed
+1 -4
+1 -4
View File
@@ -171,16 +171,13 @@ class BluettiSensor(CoordinatorEntity, SensorEntity):
self._attr_available = True
_LOGGER.error(response_data)
# Different for enum and numeric
if (
self._options is not None
and isinstance(response_data, Enum)
and response_data.value < len(self._options)
):
# Enum
self._attr_native_value = self._options[response_data.value]
self._attr_native_value = response_data.name
else:
# Numeric
self._attr_native_value = response_data