Kaynağa Gözat

sensor: Implement options property.

This allows the enum class to be used.
Jason Rumney 3 yıl önce
ebeveyn
işleme
d9e7ae6b7f
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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)