From 26eeb7e6512a5e6d4fab4262dacd61778a89c758 Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 29 Dec 2022 09:20:36 +0100 Subject: [PATCH] revert to if else syntax, to keep compatibility with python 3.9 --- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index ec248992..b8d53a57 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -31,13 +31,12 @@ class NsPanelLovelaceUIManager(hass.Hass): version = "v3.7.0" model = cfg.get("model") - match model: - case "us-l": - desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-l-{version}.tft" - case "us-p": - desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft" - case _: - desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft" + if model == "us-l": + desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-l-{version}.tft" + elif model == "us-p": + desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-us-p-{version}.tft" + else: + desired_display_firmware_url = f"http://nspanel.pky.eu/lovelace-ui/github/nspanel-{version}.tft" desired_tasmota_driver_url = "https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be" mode = cfg.get("updateMode")