瀏覽代碼

sensor: Implement options property.

This allows the enum class to be used.
Jason Rumney 3 年之前
父節點
當前提交
d9e7ae6b7f
共有 1 個文件被更改,包括 5 次插入0 次删除
  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)