Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/emonhub_auto_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ def __init__(self,settings):

if self.enabled:
self._log.debug("Automatic configuration of nodes enabled")
else:
self._log.debug("Automatic configuration of nodes disabled")

# Initialize attribute settings as a ConfigObj instance
try:
result = ConfigObj(filename, file_error=True)
self.available = self.prepare_available(result['available'])
except Exception as e:
raise EmonHubAutoConfError(e)
# Initialize attribute settings as a ConfigObj instance
try:
result = ConfigObj(filename, file_error=True)
self.available = self.prepare_available(result['available'])
except Exception as e:
raise EmonHubAutoConfError(e)

else:
self._log.debug("Automatic configuration of nodes disabled")
self.available = None

def prepare_available(self,nodes):
for n in nodes:
Expand Down