diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index b04e62ac..2f7cde4b 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -558,6 +558,8 @@ class Snapshot(JoinedWithOneDeviceMixin, ActionWithOneDevice): if not act.type == "TestDataStorage": continue data['lifetime'] = act.lifetime + if not isinstance(act.lifetime, int): + data['lifetime'] = act.lifetime.total_seconds() break hdds.append(data) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 5d9346a3..7081ce49 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -346,7 +346,7 @@ class Device(Thing): if act.type == 'Live': allocate = copy.copy(allo) - lifetime = act.usage_time_hdd + lifetime = act.usage_time_hdd.total_seconds() allocate['type'] = 'Live' allocate['liveCreate'] = act.created for hd in lifestimes: