Browse Source

text: fix min and max range decoding

Device helper returns a tuple, not a dict.

PR #3288
Jason Rumney 8 tháng trước cách đây
mục cha
commit
69ef1ef66d
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      custom_components/tuya_local/text.py

+ 2 - 2
custom_components/tuya_local/text.py

@@ -52,8 +52,8 @@ class TuyaLocalText(TuyaLocalEntity, TextEntity):
 
         range = self._value_dp.range(device, False)
         if range:
-            self._attr_native_min = range["min"]
-            self._attr_native_max = range["max"]
+            self._attr_native_min = range[0]
+            self._attr_native_max = range[1]
             self._extra_info[ATTR_MIN] = self._attr_native_min
             self._extra_info[ATTR_MAX] = self._attr_native_max