@@ -293,25 +293,25 @@ def enable_auto_gain(self, enable):
293
293
self ._tsl2561AutoGain = False
294
294
if self ._debug == True : print "enableAutoGain_end"
295
295
296
- def set_integration_time (self , time ):
296
+ def set_integration_time (self , integration_time ):
297
297
"""
298
- Sets the integration time for the TSL2561
298
+ Sets the integration integration_time for the TSL2561
299
299
300
- :param time :
300
+ :param integration_time :
301
301
:return:
302
302
"""
303
303
if self ._debug == True : print "set_integration_time"
304
304
if not self ._tsl2561Initialised :
305
- self .begin
305
+ self .begin ()
306
306
307
307
# Enable the device by setting the control bit to 0x03 */
308
308
self .enable ()
309
309
310
310
# Update the timing register */
311
- self .write8 (self .TSL2561_COMMAND_BIT | self .TSL2561_REGISTER_TIMING , time | self ._tsl2561Gain )
311
+ self .write8 (self .TSL2561_COMMAND_BIT | self .TSL2561_REGISTER_TIMING , integration_time | self ._tsl2561Gain )
312
312
313
313
# Update value placeholders */
314
- self ._tsl2561IntegrationTime = time
314
+ self ._tsl2561IntegrationTime = integration_time
315
315
316
316
# Turn the device off to save power */
317
317
self .disable ()
@@ -325,7 +325,7 @@ def set_gain(self, gain):
325
325
"""
326
326
if self ._debug == True : print "set_gain"
327
327
if not self ._tsl2561Initialised :
328
- self .begin
328
+ self .begin ()
329
329
330
330
# Enable the device by setting the control bit to 0x03 */
331
331
self .enable ()
@@ -356,7 +356,7 @@ def get_luminosity(self):
356
356
valid = False
357
357
358
358
if not self ._tsl2561Initialised :
359
- self .begin
359
+ self .begin ()
360
360
361
361
# If Auto gain disabled get a single reading and continue */
362
362
if not self ._tsl2561AutoGain :
@@ -506,6 +506,7 @@ def calculate_lux(self):
506
506
m = self .TSL2561_LUX_M8T
507
507
# endif
508
508
509
+ # noinspection PyUnboundLocalVariable,PyUnboundLocalVariable
509
510
temp = ((channel0 * b ) - (channel1 * m ))
510
511
511
512
# Do not allow negative lux value */
0 commit comments