Skip to content

Commit

Permalink
UK/EU and USA calibration mode
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed May 2, 2015
1 parent 25b62fa commit a5a2e64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions conf/emonhub.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ loglevel = DEBUG #(default:WARNING)
frequency = 433 #(default:433)
baseid = 15 #(default:15)
quiet = false #(default:true)
calibration = 230V #(UK/EU: 230V, USA: 230V)
# interval = 300 #(default:0)
# nodeoffset = 32 #(default:0)

Expand Down
8 changes: 6 additions & 2 deletions src/interfacers/EmonHubJeeInterfacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __init__(self, name, com_port='/dev/ttyAMA0', com_baud=0):
self._settings.update(self._defaults)

# 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_settings = ({'baseid': '15', 'frequency': '433', 'group': '210', 'quiet': 'True', 'calibration': '230V'})
self._jee_prefix = ({'baseid': 'i', 'frequency': '', 'group': 'g', 'quiet': 'q', 'calibration': 'p'})

# 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 @@ -191,6 +191,10 @@ def set(self, **kwargs):
command = str(setting) + 'g'
elif key == 'quiet' and int(setting) >=0 and int(setting) <2:
command = str(setting) + 'q'
elif key == 'calibration' and setting == '230V':
command = '1p'
elif key == 'calibration' and setting == '110V':
command = '2p'

else:
self._log.warning("In interfacer set '%s' is not a valid setting for %s: %s" % (str(setting), self.name, key))
Expand Down

0 comments on commit a5a2e64

Please sign in to comment.