Skip to content

Commit ac84b37

Browse files
committed
fix metadata logic + saftey check
1 parent 3af0502 commit ac84b37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_io/adafruit_io.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,10 @@ def send_group_data(
652652
'This method accepts a list of dicts with "key" and "value".'
653653
)
654654
if metadata is not None:
655-
self._post(path, {**metadata, "feeds": feeds_and_data})
655+
if not isinstance(metadata, dict):
656+
raise ValueError("Metadata must be a dictionary.")
657+
metadata.update({"feeds": feeds_and_data})
658+
self._post(path, metadata)
656659
else:
657660
self._post(path, {"feeds": feeds_and_data})
658661

0 commit comments

Comments
 (0)