Преглед изворни кода

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

Jason Rumney пре 3 година
родитељ
комит
66861b7285
1 измењених фајлова са 1 додато и 1 уклоњено
  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)