4
0
Эх сурвалжийг харах

sensor: Implement options property.

This allows the enum class to be used.
Jason Rumney 3 жил өмнө
parent
commit
d9e7ae6b7f

+ 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)