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

decoded_value: revert to returning None for decode errors.

In previous change I modified it to return the original value, but some
parts of the lightbulb logic rely on None for catching invalid values.
Jason Rumney 2 лет назад
Родитель
Сommit
780fd7fe42
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      custom_components/tuya_local/helpers/device_config.py

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

@@ -380,7 +380,7 @@ class TuyaDpsConfig:
                     v,
                     v,
                     self.name,
                     self.name,
                 )
                 )
-                return v
+                return None
 
 
         elif self.rawtype == "base64" and isinstance(v, str):
         elif self.rawtype == "base64" and isinstance(v, str):
             try:
             try:
@@ -392,7 +392,7 @@ class TuyaDpsConfig:
                     v,
                     v,
                     self.name,
                     self.name,
                 )
                 )
-                return v
+                return None
         else:
         else:
             return v
             return v