From cde5b102a194b543b87e880f466b788dcf09f36e Mon Sep 17 00:00:00 2001 From: Jevgeni Kiski Date: Mon, 26 Aug 2024 23:24:11 +0300 Subject: [PATCH] order --- paradox/interfaces/text/homeassistant_notifications.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/paradox/interfaces/text/homeassistant_notifications.py b/paradox/interfaces/text/homeassistant_notifications.py index 394299f..ed69d0b 100644 --- a/paradox/interfaces/text/homeassistant_notifications.py +++ b/paradox/interfaces/text/homeassistant_notifications.py @@ -23,13 +23,12 @@ def __init__(self, alarm): ) self.api_url = "http://supervisor/core/api/services/:domain/:service" - self.token = os.environ.get("SUPERVISOR_TOKEN") - if cfg.HOMEASSISTANT_NOTIFICATIONS_API_TOKEN: - self.token = cfg.HOMEASSISTANT_NOTIFICATIONS_API_TOKEN - if cfg.HOMEASSISTANT_NOTIFICATIONS_API_URL: self.api_url = cfg.HOMEASSISTANT_NOTIFICATIONS_API_URL + self.token = os.environ.get("SUPERVISOR_TOKEN") + if cfg.HOMEASSISTANT_NOTIFICATIONS_API_TOKEN: + self.token = cfg.HOMEASSISTANT_NOTIFICATIONS_API_TOKEN if not self.token: logger.error( f'"SUPERVISOR_TOKEN" environment variable must be set to use {__class__.__name__}'