Open
Description
Describe the bug
The output function (as modified in #12) uses an incorrect variable name channel
instead of channels
in the case where only a single channel is provided. This variable will be unassigned
def output(channels, values):
...
else:
if type(values) is list or type(values) is tuple:
for value in values:
logger.info("Output channel : {} with value : {}".format(channel, value))
else:
logger.info("Output channel : {} with value : {}".format(channel, values))
To Reproduce
Steps to reproduce the behavior:
import Mock.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(15, GPIO.OUT)
GPIO.output(15, 1)
This produces an UnboundLocalError
Expected behavior
This should not produce an UnboundLocalError
Desktop (please complete the following information):
Windows 11 / Python 3.12