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 e4234b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,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 e4234b3

Please sign in to comment.