summaryrefslogtreecommitdiff
path: root/include/py/homekit
diff options
context:
space:
mode:
authorEvgeny Sorokin <me@ch1p.io>2024-01-17 03:35:59 +0300
committerEvgeny Sorokin <me@ch1p.io>2024-01-17 03:35:59 +0300
commita9a241ad19449c29b68cd4a5b539bcbec816e341 (patch)
tree2ebfc73b206e4cec30fd94613bd6bf42ef5b269d /include/py/homekit
parent8a89dd77be03ca8eb9cdc378ba8e912292494fa9 (diff)
lws: pump page rewritten to python
Diffstat (limited to 'include/py/homekit')
-rw-r--r--include/py/homekit/util.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/py/homekit/util.py b/include/py/homekit/util.py
index f267488..78a78a0 100644
--- a/include/py/homekit/util.py
+++ b/include/py/homekit/util.py
@@ -12,7 +12,7 @@ import re
import os
from enum import Enum
-from datetime import datetime, timedelta
+from datetime import datetime
from typing import Optional, List
from zlib import adler32
@@ -256,8 +256,7 @@ def filesize_fmt(num, suffix="B") -> str:
def seconds_to_human_readable_string(seconds: int) -> str:
- duration = timedelta(seconds=seconds)
- days, remainder = divmod(duration.total_seconds(), 86400)
+ days, remainder = divmod(seconds, 86400)
hours, remainder = divmod(remainder, 3600)
minutes, seconds = divmod(remainder, 60)