Explorar o código

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 %!s(int64=2) %!d(string=hai) anos
pai
achega
780fd7fe42
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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,
                     self.name,
                 )
-                return v
+                return None
 
         elif self.rawtype == "base64" and isinstance(v, str):
             try:
@@ -392,7 +392,7 @@ class TuyaDpsConfig:
                     v,
                     self.name,
                 )
-                return v
+                return None
         else:
             return v