Răsfoiți Sursa

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 ani în urmă
părinte
comite
780fd7fe42
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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