First sort of working mqtt routines
This commit is contained in:
@@ -38,6 +38,9 @@ class config_reader:
|
||||
if self.test_modbus_servers_settings() == 0:
|
||||
return 0
|
||||
|
||||
if self.aprs_settings() == 0:
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
def read_config_file (self):
|
||||
@@ -50,7 +53,7 @@ class config_reader:
|
||||
else:
|
||||
return 1
|
||||
|
||||
# Test if all settings are pressebt
|
||||
# Test if all settings are pressent
|
||||
def test_global_settings(self):
|
||||
# Test is all expected settings are present
|
||||
try:
|
||||
@@ -63,7 +66,7 @@ class config_reader:
|
||||
else:
|
||||
return 1
|
||||
|
||||
# Test if all settings are pressebt
|
||||
# Test if all settings are pressent
|
||||
def test_modbus_settings(self):
|
||||
# Test is all expected settings are present
|
||||
try:
|
||||
@@ -84,3 +87,17 @@ class config_reader:
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
|
||||
def aprs_settings(self):
|
||||
for entry in self.config_file_settings['aprs']:
|
||||
try:
|
||||
tmp = tmp = entry['port']
|
||||
tmp = entry['call']
|
||||
tmp = entry['destination']
|
||||
tmp = entry['digi_path']
|
||||
tmp = entry['interval']
|
||||
except:
|
||||
print ("Error in the aprs section of the configuration file.")
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
|
Reference in New Issue
Block a user