So I'm making python voice control for my smart lights. But when I say 'crimson' it triggers 'on' and 'crimson' at the same time because the word 'crimson' contains 'on' at the end. I really don't want to change the name to something else.
elif ('light' in query) or ('lights' in query): # Home automation
if 'on' in query:
control_lights("light on")
speak("okay, turning on light")
if 'off' in query:
control_lights("light off")
speak("okay, turning off light")
if 'crimson' in query:
control_lights("light crimson")
speak("okay, turning light to crimson")