From 30bd9752c0ac69bef4d5639434f2e849d3c453bb Mon Sep 17 00:00:00 2001 From: pb66 Date: Thu, 27 Nov 2014 13:09:04 +0000 Subject: [PATCH] Improved "Jee setting" checks Minor changes to the way setting strings are tested for on post RF12demo.11 devices. --- src/emonhub_interfacer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emonhub_interfacer.py b/src/emonhub_interfacer.py index ec92b34..9453aaf 100644 --- a/src/emonhub_interfacer.py +++ b/src/emonhub_interfacer.py @@ -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")): @@ -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