Skip to content

Commit

Permalink
ui: guess WAS URL from interface IP if WAS_IP is unset
Browse files Browse the repository at this point in the history
  • Loading branch information
stintel committed Jul 13, 2023
1 parent ea80af6 commit 705af96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
apply_config_host,
apply_nvs_host,
construct_url,
get_ip,
get_nvs,
ota,
get_config,
Expand Down Expand Up @@ -93,7 +94,10 @@
was_url = ""
if len(user_nvs) == 0:
try:
was_url = f"ws://{environ['WAS_IP']}:8502/ws"
if environ.get('WAS_IP') is not None:
was_url = f"ws://{environ['WAS_IP']}:8502/ws"
else:
was_url = f"ws://{get_ip()}:8502/ws"
st.info("We tried to guess your WAS URL. Please make sure your Willow devices can reach this URL!")
except Exception:
st.info("We couldn't guess your WAS URL. Please make sure your Willow devices can reach the URL you enter!")
Expand Down

0 comments on commit 705af96

Please sign in to comment.