diff --git a/app.py b/app.py index 4f8478f..b61c1b4 100644 --- a/app.py +++ b/app.py @@ -122,7 +122,7 @@ def fetch_hourly_forecast(): return response.json() -def create_payload(icon, text1="", text2=None, font="(5) LITERY 112X17", invert=False, auto_break=False, align="center"): +def create_payload(icon, text1="", text2=None, font=text_font, invert=False, auto_break=False, align=text_align): result = { "addition": { "addition_type": "icon", @@ -137,7 +137,7 @@ def create_payload(icon, text1="", text2=None, font="(5) LITERY 112X17", invert= "font": font, "invert": invert, "auto_break": auto_break, - "align": "center" + "align": align }) if text2: result["lines"].append({ @@ -145,7 +145,7 @@ def create_payload(icon, text1="", text2=None, font="(5) LITERY 112X17", invert= "font": font, "invert": invert, "auto_break": auto_break, - "align": "center" + "align": align }) return result @@ -212,7 +212,7 @@ def send_mqtt(page, payload): def main(): current_weather = fetch_current_weather() forecast = fetch_hourly_forecast() - payloads = generate_payload(current_weather, forecast, font=text_font, align=text_align) + payloads = generate_payload(current_weather, forecast) if is_post: clean() for i, payload in enumerate(payloads):