Просмотр исходного кода

Fix instance check in unixtime handling

Jason Rumney 2 лет назад
Родитель
Сommit
34f12732e8
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      custom_components/tuya_local/helpers/device_config.py

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

@@ -446,7 +446,7 @@ class TuyaDpsConfig:
             return v.hex()
             return v.hex()
         elif self.rawtype == "base64":
         elif self.rawtype == "base64":
             return b64encode(v).decode("utf-8")
             return b64encode(v).decode("utf-8")
-        elif self.rawtype == "unixtime" and v instanceof datetime:
+        elif self.rawtype == "unixtime" and isinstance(v, datetime):
             return v.timestamp()
             return v.timestamp()
         else:
         else:
             return v
             return v