Skip to content

Commit

Permalink
V1.19.03
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyates committed Apr 30, 2024
1 parent 27c00fb commit 8e7feb8
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 14 deletions.
7 changes: 5 additions & 2 deletions addon/gencthat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion addon/gencustomgpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 3 additions & 2 deletions addon/genexercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 4 additions & 1 deletion addon/genmopeka.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions addon/genmqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions addon/genmqttin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion addon/gensnmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion addon/gentankdiy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion addon/gentankutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 4 additions & 1 deletion addon/gentemp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 8e7feb8

Please sign in to comment.