Explorar o código

text: fix min and max range decoding

Device helper returns a tuple, not a dict.

PR #3288
Jason Rumney hai 9 meses
pai
achega
69ef1ef66d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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)
         range = self._value_dp.range(device, False)
         if range:
         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_MIN] = self._attr_native_min
             self._extra_info[ATTR_MAX] = self._attr_native_max
             self._extra_info[ATTR_MAX] = self._attr_native_max