From 99769ca8ad18db4b82981c77542644d6bd58d8d6 Mon Sep 17 00:00:00 2001 From: sstent Date: Mon, 15 Dec 2025 07:57:10 -0800 Subject: [PATCH] sync --- fitbitsync.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fitbitsync.py b/fitbitsync.py index dcb8be6..187bd6c 100644 --- a/fitbitsync.py +++ b/fitbitsync.py @@ -151,6 +151,12 @@ class ConfigManager: # Value is base64 encoded JSON encoded_value = data['Value'] logger.debug(f"Consul encoded value: {encoded_value}") + + # Add padding if necessary for base64 decoding + padding_needed = len(encoded_value) % 4 + if padding_needed != 0: + encoded_value += '=' * (4 - padding_needed) + decoded_json_str = base64.b64decode(encoded_value).decode('utf-8') logger.debug(f"Consul decoded JSON string: {decoded_json_str}") consul_conf = json.loads(decoded_json_str) # Parse the JSON