|
|
@@ -432,12 +432,6 @@ class TuyaDpsConfig:
|
|
|
self.name,
|
|
|
)
|
|
|
return None
|
|
|
- elif self.rawtype == "unixtime" and isinstance(v, int):
|
|
|
- try:
|
|
|
- return datetime.fromtimestamp(v)
|
|
|
- except:
|
|
|
- _LOGGER.warning("Invalid timestamp %d", v)
|
|
|
- return None
|
|
|
else:
|
|
|
return v
|
|
|
|
|
|
@@ -696,6 +690,13 @@ class TuyaDpsConfig:
|
|
|
result = result / scale
|
|
|
replaced = True
|
|
|
|
|
|
+ if self.rawtype == "unixtime" and isinstance(result, int):
|
|
|
+ try:
|
|
|
+ result = datetime.fromtimestamp(result)
|
|
|
+ replaced = true
|
|
|
+ except:
|
|
|
+ _LOGGER.warning("Invalid timestamp %d", result)
|
|
|
+
|
|
|
if replaced:
|
|
|
_LOGGER.debug(
|
|
|
"%s: Mapped dps %s value from %s to %s",
|