Explorar o código

sensor: Implement options property.

This allows the enum class to be used.
Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
d9e7ae6b7f
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      custom_components/tuya_local/sensor.py

+ 5 - 0
custom_components/tuya_local/sensor.py

@@ -84,3 +84,8 @@ class TuyaLocalSensor(TuyaLocalEntity, SensorEntity):
     def native_precision(self):
         """Return the precision for the sensor"""
         return self._sensor_dps.precision(self._device)
+
+    @property
+    def options(self):
+        """Return a set of possible options."""
+        return self._sensor_dps.values(self._device)