Skip to content

Commit

Permalink
fix metadata logic + saftey check
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Jul 16, 2024
1 parent 3af0502 commit ac84b37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,10 @@ def send_group_data(
'This method accepts a list of dicts with "key" and "value".'
)
if metadata is not None:
self._post(path, {**metadata, "feeds": feeds_and_data})
if not isinstance(metadata, dict):
raise ValueError("Metadata must be a dictionary.")
metadata.update({"feeds": feeds_and_data})
self._post(path, metadata)
else:
self._post(path, {"feeds": feeds_and_data})

Expand Down

0 comments on commit ac84b37

Please sign in to comment.