[go: nahoru, domu]

Skip to content

Commit

Permalink
Improved "Jee setting" checks
Browse files Browse the repository at this point in the history
Minor changes to the way setting strings are tested for on post
RF12demo.11 devices.
  • Loading branch information
pb66 committed Nov 27, 2014
1 parent de60cdf commit 30bd975
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/emonhub_interfacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def __init__(self, name, com_port='/dev/ttyAMA0', com_baud=0):

# Jee specific settings to be picked up as changes not defaults to initialise "Jee" device
self._jee_settings = ({'baseid': '15', 'frequency': '433', 'group': '210', 'quiet': 'True'})
self._jee_prefix = ({'baseid': 'i', 'frequency': '@ ', 'group': 'g', 'quiet': 'q'})
self._jee_prefix = ({'baseid': 'i', 'frequency': '', 'group': 'g', 'quiet': 'q'})

# Pre-load Jee settings only if info string available for checks
if all(i in self.info[1] for i in (" i", " g", " @ ", " MHz")):
Expand Down Expand Up @@ -546,7 +546,7 @@ def set(self, **kwargs):
# confirmation string always contains baseid, group anf freq
if " i" and " g" and " @ " and " MHz" in self.info[1]:
# If setting confirmed as already set, continue without changing
if (self._jee_prefix[key] + str(setting)) in self.info[1]:
if (self._jee_prefix[key] + str(setting)) in self.info[1].split():
continue
elif key in self._settings and self._settings[key] == setting:
continue
Expand Down

0 comments on commit 30bd975

Please sign in to comment.