Adds utilities, persistance, and period sends of Watchdog

This commit is contained in:
Patrick McDonagh
2017-10-16 11:36:45 -05:00
parent 55f518e7d3
commit d6f94609df
4 changed files with 52 additions and 28 deletions

View File

@@ -0,0 +1,11 @@
"""Utility functions for the driver."""
import socket
def get_public_ip_address():
"""Find the public IP Address of the host device."""
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.close()
return ip