Skip to content

Commit

Permalink
Modified Params dictionary in all Sensor files
Browse files Browse the repository at this point in the history
 Fixes fossasia#55. Improved GUI menus
  • Loading branch information
jithinbp committed Apr 30, 2017
1 parent 9b0f57b commit 3e799a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions PSL/SENSORS/BH1750.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BRIDGE():
# for changing various options of this sensor
# It's a dictionary of the string representations of functions matched with an array
# of options that each one can accept
params = {'init': ['Now'],
params = {'init': None,
'setRange': gain_literal_choices,
}

Expand All @@ -35,9 +35,9 @@ class BRIDGE():
def __init__(self, I2C, **args):
self.I2C = I2C
self.ADDRESS = args.get('address', 0x23)
self.init('')
self.init()

def init(self, dummy_variable_to_circumvent_framework_limitation): # I know how to fix this now. remind me.
def init(self):
self.I2C.writeBulk(self.ADDRESS, [self.RES_500mLx])

def setRange(self, g):
Expand Down
6 changes: 3 additions & 3 deletions PSL/SENSORS/HMC5883L.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class HMC5883L():
# for changing various options of this sensor
# It's a dictionary of the string representations of functions matched with an array
# of options that each one can accept
params = {'init': ['Now'],
params = {'init': None,
'setSamplesToAverage': samplesToAverage_choices,
'setDataOutputRate': dataOutputRate_choices,
'setGain': gain_choices,
Expand All @@ -51,9 +51,9 @@ def __init__(self, I2C, **args):
except:
print 'FAILED TO CHANGE BAUD RATE'
'''
self.init('')
self.init()

def init(self, dummy_variable_to_circumvent_framework_limitation): # I know how to fix this now. remind me.
def init(self):
self.__writeCONFA__()
self.__writeCONFB__()
self.I2C.writeBulk(self.ADDRESS, [self.MODE, 0]) # enable continuous measurement mode
Expand Down
2 changes: 1 addition & 1 deletion PSL/SENSORS/MLX90614.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, I2C, **args):
self.source = self.OBJADDR

self.name = 'Passive IR temperature sensor'
self.params = {'readReg': range(0x20),
self.params = {'readReg': {'dataType':'integer','min':0,'max':0x20,'prefix':'Addr: '} ,
'select_source': ['object temperature', 'ambient temperature']}

try:
Expand Down
6 changes: 3 additions & 3 deletions PSL/SENSORS/SHT21.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def __init__(self, I2C, **args):
except:
print ('FAILED TO CHANGE BAUD RATE')
'''
self.params = {'selectParameter': ['temperature', 'humidity']}
self.init('')
self.params = {'selectParameter': ['temperature', 'humidity'],'init':None}
self.init()

def init(self, x):
def init(self):
self.I2C.writeBulk(self.ADDRESS, [self.RESET]) # soft reset
time.sleep(0.1)

Expand Down

0 comments on commit 3e799a1

Please sign in to comment.