mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-24 00:14:26 +01:00
if home_assistant_token is in settings the use that for external HA server
This commit is contained in:
@@ -78,15 +78,18 @@ def get_config():
|
||||
if not settings.get("mqtt_server"):
|
||||
settings["mqtt_server"] = os.getenv('MQTT_SERVER')
|
||||
|
||||
st = os.getenv('SUPERVISOR_TOKEN')
|
||||
|
||||
settings["is_addon"] = False
|
||||
if st is not None:
|
||||
settings["home_assistant_token"] = st
|
||||
print(settings["home_assistant_token"])
|
||||
settings["home_assistant_address"] = "http://supervisor"
|
||||
settings["is_addon"] = True
|
||||
|
||||
if not settings.get("home_assistant_token"):
|
||||
st = os.getenv('SUPERVISOR_TOKEN')
|
||||
if st is not None:
|
||||
settings["home_assistant_token"] = st
|
||||
settings["home_assistant_address"] = "http://supervisor"
|
||||
settings["is_addon"] = True
|
||||
|
||||
print(settings["home_assistant_token"])
|
||||
print(settings["home_assistant_address"])
|
||||
|
||||
def connect_and_loop():
|
||||
global settings, home_assistant, panels
|
||||
|
||||
Reference in New Issue
Block a user