httpd into https

This commit is contained in:
2020-09-17 15:42:27 -05:00
parent 1bddf77591
commit 206dd5fd4a
3 changed files with 5 additions and 13 deletions

View File

@@ -101,7 +101,7 @@ class start(threading.Thread, deviceBase):
mqtt=mqtt, Nodes=Nodes)
self.daemon = True
self.version = "25"
self.version = "26"
self.finished = threading.Event()
self.force_send = False
self.public_ip_address = ""

View File

@@ -3,7 +3,7 @@
"driverFileName":"PiFlow.py",
"deviceName":"piflow",
"driverId":"0280",
"releaseVersion":"25",
"releaseVersion":"26",
"files": {
"file1":"PiFlow.py",
"file2":"Channel.py",

View File

@@ -18,12 +18,12 @@ def get_private_ip_address():
def get_public_ip_address():
ip_address = "0.0.0.0"
try:
with contextlib.closing(urllib.urlopen("httpd://checkip.amazonaws.com")) as url:
with contextlib.closing(urllib.urlopen("http://checkip.amazonaws.com")) as url:
ip_address = url.read()
except Exception as e:
print("Could not resolve address: {}".format(e))
return ip_address
return ip_address[:-1]
return ip_address
def int_to_float16(int_to_convert):
@@ -60,12 +60,4 @@ def degf_to_degc(temp_f):
def degc_to_degf(temp_c):
"""Convert deg C to deg F."""
return temp_c * 1.8 + 32.0
def get_public_ip_address():
try:
url = urllib.urlopen("http://checkip.amazonaws.com")
ip_address = url.read()
except Exception as e:
return e
return ip_address
return temp_c * 1.8 + 32.0