|
@@ -716,21 +716,21 @@ class TuyaDpsConfig:
|
|
|
result = result / scale
|
|
result = result / scale
|
|
|
replaced = True
|
|
replaced = True
|
|
|
|
|
|
|
|
- if self.rawtype == "unixtime" and isinstance(result, int):
|
|
|
|
|
- try:
|
|
|
|
|
- result = datetime.fromtimestamp(result)
|
|
|
|
|
- replaced = True
|
|
|
|
|
- except Exception:
|
|
|
|
|
- _LOGGER.warning("Invalid timestamp %d", result)
|
|
|
|
|
|
|
+ if self.rawtype == "unixtime" and isinstance(result, int):
|
|
|
|
|
+ try:
|
|
|
|
|
+ result = datetime.fromtimestamp(result)
|
|
|
|
|
+ replaced = True
|
|
|
|
|
+ except Exception:
|
|
|
|
|
+ _LOGGER.warning("Invalid timestamp %d", result)
|
|
|
|
|
|
|
|
- if replaced:
|
|
|
|
|
- _LOGGER.debug(
|
|
|
|
|
- "%s: Mapped dps %s value from %s to %s",
|
|
|
|
|
- self._entity._device.name,
|
|
|
|
|
- self.id,
|
|
|
|
|
- val,
|
|
|
|
|
- result,
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ if replaced:
|
|
|
|
|
+ _LOGGER.debug(
|
|
|
|
|
+ "%s: Mapped dps %s value from %s to %s",
|
|
|
|
|
+ self._entity._device.name,
|
|
|
|
|
+ self.id,
|
|
|
|
|
+ val,
|
|
|
|
|
+ result,
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
return result
|
|
return result
|
|
|
|
|
|