summaryrefslogtreecommitdiff
path: root/include/py/homekit/util.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2024-02-18 01:35:57 +0300
committerEvgeny Zinoviev <me@ch1p.io>2024-02-18 01:35:57 +0300
commit42155370475b1f6619498ec2c43c1c7f328ce1a1 (patch)
treeaa7a708bb94362e0c79d7f3678d07883baa4ba76 /include/py/homekit/util.py
parent70b4a4f044cac8052bb0af7c585572e54489ea2f (diff)
lws: wip
Diffstat (limited to 'include/py/homekit/util.py')
-rw-r--r--include/py/homekit/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/py/homekit/util.py b/include/py/homekit/util.py
index 7732d3b..c686f29 100644
--- a/include/py/homekit/util.py
+++ b/include/py/homekit/util.py
@@ -12,7 +12,7 @@ import re
import os
import ipaddress
-from collections import namedtuple
+from collections.abc import KeysView
from enum import Enum
from datetime import datetime
from typing import Optional, List
@@ -119,6 +119,8 @@ def json_serial(obj):
return obj.timestamp()
if isinstance(obj, Enum):
return obj.value
+ if isinstance(obj, KeysView):
+ return list(obj)
raise TypeError("Type %s not serializable" % type(obj))