Browse Source

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

Jason Rumney 3 years ago
parent
commit
66861b7285
1 changed files with 1 additions and 1 deletions
  1. 1 1
      custom_components/tuya_local/helpers/device_config.py

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

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