Răsfoiți Sursa

text: fix min and max range decoding

Device helper returns a tuple, not a dict.

PR #3288
Jason Rumney 11 luni în urmă
părinte
comite
69ef1ef66d
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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