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

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 1 неделя назад
Родитель
Сommit
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)