diff --git a/addon/gencthat.py b/addon/gencthat.py index 98b23ffb..cd2af902 100644 --- a/addon/gencthat.py +++ b/addon/gencthat.py @@ -185,10 +185,13 @@ def __init__( self.debug = self.config.ReadValue("debug", return_type=bool, default=False) self.LogDebug("Multiplier: " + str(self.Multiplier)) + + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() - + except Exception as e1: self.LogErrorLine("Error reading " + configfile + ": " + str(e1)) self.LogConsole("Error reading " + configfile + ": " + str(e1)) diff --git a/addon/gencustomgpio.py b/addon/gencustomgpio.py index 79bbd8cc..d2897bed 100644 --- a/addon/gencustomgpio.py +++ b/addon/gencustomgpio.py @@ -150,9 +150,11 @@ def __init__( ) # Validate settings + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() except Exception as e1: self.LogErrorLine( diff --git a/addon/genexercise.py b/addon/genexercise.py index 13c6a00f..f31067ea 100644 --- a/addon/genexercise.py +++ b/addon/genexercise.py @@ -138,10 +138,11 @@ def __init__( if not self.ExerciseFrequency.lower() in ["daily","weekly", "biweekly", "monthly", "post-controller"]: self.ExerciseFrequency = "Monthly" + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - - self.MonitorAddress = self.MonitorAddress.strip() except Exception as e1: self.LogErrorLine( diff --git a/addon/genmopeka.py b/addon/genmopeka.py index 64cf185f..40b19bac 100644 --- a/addon/genmopeka.py +++ b/addon/genmopeka.py @@ -107,9 +107,12 @@ def __init__( self.min_reading_quality = self.config.ReadValue("min_reading_quality", return_type=int, default=0, NoLog=True) self.UseMopekaLib = self.config.ReadValue("use_old_lib", return_type=bool, default=False) + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() + except Exception as e1: self.LogErrorLine("Error reading " + configfile + ": " + str(e1)) diff --git a/addon/genmqtt.py b/addon/genmqtt.py index 84abd825..0f678077 100644 --- a/addon/genmqtt.py +++ b/addon/genmqtt.py @@ -413,11 +413,11 @@ def __init__( self.MonitorAddress = config.ReadValue( "monitor_address", default=self.MonitorAddress ) + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() - self.MQTTPort = config.ReadValue("mqtt_port", return_type=int, default=1883) self.PollTime = config.ReadValue( "poll_interval", return_type=float, default=2.0 diff --git a/addon/genmqttin.py b/addon/genmqttin.py index 3c4d9b47..426f0aae 100644 --- a/addon/genmqttin.py +++ b/addon/genmqttin.py @@ -105,10 +105,11 @@ def __init__( self.MonitorAddress = config.ReadValue("monitor_address", default=self.MonitorAddress) + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - - self.MonitorAddress = self.MonitorAddress.strip() self.MQTTPort = config.ReadValue("mqtt_port", return_type=int, default=1883) self.TopicRoot = config.ReadValue("root_topic") diff --git a/addon/gensnmp.py b/addon/gensnmp.py index f643e290..fa994e99 100644 --- a/addon/gensnmp.py +++ b/addon/gensnmp.py @@ -195,9 +195,12 @@ def __init__( if self.UseIntegerValues: self.UseNumeric = True + + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() except Exception as e1: self.LogErrorLine("Error reading " + configfile + ": " + str(e1)) diff --git a/addon/gentankdiy.py b/addon/gentankdiy.py index 901a4feb..2e3dece7 100755 --- a/addon/gentankdiy.py +++ b/addon/gentankdiy.py @@ -89,9 +89,11 @@ def __init__( "nb_tanks", return_type=int, default=1 ) + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() except Exception as e1: self.LogErrorLine("Error reading " + configfile + ": " + str(e1)) diff --git a/addon/gentankutil.py b/addon/gentankutil.py index 15a9b3e8..5623da6f 100644 --- a/addon/gentankutil.py +++ b/addon/gentankutil.py @@ -96,9 +96,10 @@ def __init__( self.check_reading = self.config.ReadValue("check_reading", return_type=bool, default=False) self.reading_timeout = self.config.ReadValue("reading_timeout", return_type=int, default=50) + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() except Exception as e1: self.LogErrorLine("Error reading " + configfile + ": " + str(e1)) diff --git a/addon/gentemp.py b/addon/gentemp.py index ea3c0ad0..c744bd81 100644 --- a/addon/gentemp.py +++ b/addon/gentemp.py @@ -103,9 +103,12 @@ def __init__( self.DeviceMaxValues = self.GetParamList(self.config.ReadValue("device_max_values", default=None), bInteger=True) self.BlackList = self.GetParamList(self.config.ReadValue("blacklist", default=None)) + if self.MonitorAddress != None: + self.MonitorAddress = self.MonitorAddress.strip() + if self.MonitorAddress == None or not len(self.MonitorAddress): self.MonitorAddress = ProgramDefaults.LocalHost - self.MonitorAddress = self.MonitorAddress.strip() + except Exception as e1: self.LogErrorLine("Error reading " + configfile + ": " + str(e1))