فهرست منبع

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)