diff --git a/piflow/PiFlow.py b/piflow/PiFlow.py index 6738da0..2e77044 100644 --- a/piflow/PiFlow.py +++ b/piflow/PiFlow.py @@ -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 = "" diff --git a/piflow/config.txt b/piflow/config.txt index be442e9..d4d0443 100644 --- a/piflow/config.txt +++ b/piflow/config.txt @@ -3,7 +3,7 @@ "driverFileName":"PiFlow.py", "deviceName":"piflow", "driverId":"0280", -"releaseVersion":"25", +"releaseVersion":"26", "files": { "file1":"PiFlow.py", "file2":"Channel.py", diff --git a/piflow/utilities.py b/piflow/utilities.py index f9b2081..fbf6f58 100644 --- a/piflow/utilities.py +++ b/piflow/utilities.py @@ -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 \ No newline at end of file