@@ -293,25 +293,25 @@ def enable_auto_gain(self, enable):
293293 self ._tsl2561AutoGain = False
294294 if self ._debug == True : print "enableAutoGain_end"
295295
296- def set_integration_time (self , time ):
296+ def set_integration_time (self , integration_time ):
297297 """
298- Sets the integration time for the TSL2561
298+ Sets the integration integration_time for the TSL2561
299299
300- :param time :
300+ :param integration_time :
301301 :return:
302302 """
303303 if self ._debug == True : print "set_integration_time"
304304 if not self ._tsl2561Initialised :
305- self .begin
305+ self .begin ()
306306
307307 # Enable the device by setting the control bit to 0x03 */
308308 self .enable ()
309309
310310 # 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 )
312312
313313 # Update value placeholders */
314- self ._tsl2561IntegrationTime = time
314+ self ._tsl2561IntegrationTime = integration_time
315315
316316 # Turn the device off to save power */
317317 self .disable ()
@@ -325,7 +325,7 @@ def set_gain(self, gain):
325325 """
326326 if self ._debug == True : print "set_gain"
327327 if not self ._tsl2561Initialised :
328- self .begin
328+ self .begin ()
329329
330330 # Enable the device by setting the control bit to 0x03 */
331331 self .enable ()
@@ -356,7 +356,7 @@ def get_luminosity(self):
356356 valid = False
357357
358358 if not self ._tsl2561Initialised :
359- self .begin
359+ self .begin ()
360360
361361 # If Auto gain disabled get a single reading and continue */
362362 if not self ._tsl2561AutoGain :
@@ -506,6 +506,7 @@ def calculate_lux(self):
506506 m = self .TSL2561_LUX_M8T
507507 # endif
508508
509+ # noinspection PyUnboundLocalVariable,PyUnboundLocalVariable
509510 temp = ((channel0 * b ) - (channel1 * m ))
510511
511512 # Do not allow negative lux value */
0 commit comments