Skip to content

Commit

Permalink
Refactor to minimize extra resource rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Apr 23, 2024
1 parent e1147bd commit 47fb9e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,16 @@ def handle_query_ip(self, message):
public = False
addr = get_ifaces(message=message)

dot = self.resources.render_dialog("dot")

if len(addr) == 0: # No IP Address found
if not get_user_prefs(message)["response_mode"].get(
"limit_dialog"):
self.speak_dialog("no network connection", private=True)
else:
self.speak("I'm not connected to a network", private=True)
return

dot = self.resources.render_dialog("dot")

if len(addr) == 1: # Single IP Address to speak
iface, ip = addr.popitem()
ip_spoken = f" {dot} ".join([pronounce_number(int(part))
Expand Down

0 comments on commit 47fb9e7

Please sign in to comment.