Skip to content

Commit 3e799a1

Browse files
committed
Modified Params dictionary in all Sensor files
Fixes fossasia#55. Improved GUI menus
1 parent 9b0f57b commit 3e799a1

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

PSL/SENSORS/BH1750.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BRIDGE():
2323
# for changing various options of this sensor
2424
# It's a dictionary of the string representations of functions matched with an array
2525
# of options that each one can accept
26-
params = {'init': ['Now'],
26+
params = {'init': None,
2727
'setRange': gain_literal_choices,
2828
}
2929

@@ -35,9 +35,9 @@ class BRIDGE():
3535
def __init__(self, I2C, **args):
3636
self.I2C = I2C
3737
self.ADDRESS = args.get('address', 0x23)
38-
self.init('')
38+
self.init()
3939

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

4343
def setRange(self, g):

PSL/SENSORS/HMC5883L.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class HMC5883L():
3030
# for changing various options of this sensor
3131
# It's a dictionary of the string representations of functions matched with an array
3232
# of options that each one can accept
33-
params = {'init': ['Now'],
33+
params = {'init': None,
3434
'setSamplesToAverage': samplesToAverage_choices,
3535
'setDataOutputRate': dataOutputRate_choices,
3636
'setGain': gain_choices,
@@ -51,9 +51,9 @@ def __init__(self, I2C, **args):
5151
except:
5252
print 'FAILED TO CHANGE BAUD RATE'
5353
'''
54-
self.init('')
54+
self.init()
5555

56-
def init(self, dummy_variable_to_circumvent_framework_limitation): # I know how to fix this now. remind me.
56+
def init(self):
5757
self.__writeCONFA__()
5858
self.__writeCONFB__()
5959
self.I2C.writeBulk(self.ADDRESS, [self.MODE, 0]) # enable continuous measurement mode

PSL/SENSORS/MLX90614.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, I2C, **args):
2121
self.source = self.OBJADDR
2222

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

2727
try:

PSL/SENSORS/SHT21.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def __init__(self, I2C, **args):
3131
except:
3232
print ('FAILED TO CHANGE BAUD RATE')
3333
'''
34-
self.params = {'selectParameter': ['temperature', 'humidity']}
35-
self.init('')
34+
self.params = {'selectParameter': ['temperature', 'humidity'],'init':None}
35+
self.init()
3636

37-
def init(self, x):
37+
def init(self):
3838
self.I2C.writeBulk(self.ADDRESS, [self.RESET]) # soft reset
3939
time.sleep(0.1)
4040

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy