From ac84b37052461f1c29d1aeed841b3d5688cc5714 Mon Sep 17 00:00:00 2001 From: Tyeth Gundry Date: Tue, 16 Jul 2024 16:01:10 +0100 Subject: [PATCH] fix metadata logic + saftey check --- adafruit_io/adafruit_io.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adafruit_io/adafruit_io.py b/adafruit_io/adafruit_io.py index e59b4c7..085273c 100755 --- a/adafruit_io/adafruit_io.py +++ b/adafruit_io/adafruit_io.py @@ -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})