I've written a python program using flask-ask to make a custom alexa skill that controls a stepper motor. When Alexa runs the skill it runs and asks which position I want with a value from one through seven. However I'm unsure if I'm defining my function and arguments correctly. The code below contains the intent that is in my Alexa skill, and the first position the motor could be set to. Any feedback to the way I've defined my function, included arguments, and am linking them to my if statements and if it needs to be done differently would be appreciated.
#Position intent, this is our answer to the welcome message
@ask.intent("PositionIntent", convert ={'one': int, 'two': int, 'three': int,
'four': int, 'five': int, 'six': int,
'seven': int})
def position(one, two, three, four, five, six, seven):
if [one] == 1:
if (pos1 < previous_position):
step_count = abs(pos1 - previous_position)
turn_motor()
previous_position = pos1
else:
GPIO.output(DIR, CCW)
step_count = abs(pos1 - previous_position)
turn_motor()
previous_position = pos1
GPIO.cleanup()