Просмотр исходного кода

text: fix min and max range decoding

Device helper returns a tuple, not a dict.

PR #3288
Jason Rumney 8 месяцев назад
Родитель
Сommit
69ef1ef66d
1 измененных файлов с 2 добавлено и 2 удалено
  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