4
0
Эх сурвалжийг харах

Avoid error when decoding hex for a value that is not available.

Jason Rumney 3 жил өмнө
parent
commit
66861b7285

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

@@ -326,7 +326,7 @@ class TuyaDpsConfig:
 
 
     def decoded_value(self, device):
     def decoded_value(self, device):
         v = self.get_value(device)
         v = self.get_value(device)
-        if self.rawtype == "hex":
+        if self.rawtype == "hex" and isinstance(v, str):
             return bytes.fromhex(v)
             return bytes.fromhex(v)
         elif self.rawtype == "base64":
         elif self.rawtype == "base64":
             return b64decode(v)
             return b64decode(v)