소스 검색

fix(device_config): invert getting wrong default value in condition

When there is a condition, and no invert, the default was set from value instead
of invert, causing wrong behaviour.
Jason Rumney 2 달 전
부모
커밋
0a998b6ba9
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      custom_components/tuya_local/helpers/device_config.py

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

@@ -807,7 +807,7 @@ class TuyaDpsConfig:
                     return None
                 replaced = replaced or "value" in cond
                 result = cond.get("value", result)
-                invert = cond.get("invert", result)
+                invert = cond.get("invert", invert)
                 redirect = cond.get("value_redirect", redirect)
                 mirror = cond.get("value_mirror", mirror)
                 target_range = cond.get("target_range", target_range)