소스 검색

Avoid range checking non-numeric values.

Where there is a mapping from string values into a numeric HA representation,
we still need to report the range for the UI to function correctly, but do
not want to range check the values when setting, as the mapping should take
care of setting the correct values.

Should fix the exception when setting humidity in issue #263
Jason Rumney 3 년 전
부모
커밋
8f24a0d0fe
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      custom_components/tuya_local/helpers/device_config.py

+ 1 - 1
custom_components/tuya_local/helpers/device_config.py

@@ -705,7 +705,7 @@ class TuyaDpsConfig:
                 )
 
         r = self.range(device, scaled=False)
-        if r:
+        if r and isinstance(result, (int, float)):
             minimum = r["min"]
             maximum = r["max"]
             if result < minimum or result > maximum: