summaryrefslogtreecommitdiff
path: root/include/py/homekit/util.py
diff options
context:
space:
mode:
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))