Parcourir la source

text: fix min and max range decoding

Device helper returns a tuple, not a dict.

PR #3288
Jason Rumney il y a 11 mois
Parent
commit
69ef1ef66d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  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