Sfoglia il codice sorgente

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 3 giorni fa
parent
commit
0a998b6ba9
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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)