I recently replaced a Leviton PR180-1LW Decora motion sensor light switch. The switch had four wires: red, black, green/ground, and yellow with a red stripe. The green, red, and black wires were connected to green, red, and black wires in the wall. But the yellow wire was connected to a second red wire from the wall. I believe this was in order to use it as a three way switch, though the second switch in this arrangement never functioned since we moved in.
I replaced the switch with a TOPGREENER TSOS5 switch. This switch included red, black, green/ground, and white/neutral wires. I connected the red, black, and greens to the same wires that my previous switch was connected to, and then connected the white wire to the previously unused white/neutral wire in my wall. But I was left with the extra red wire in my wall that was previously connected to the yellow wire in my old switch. I put a cap on this extra red wire, and everything seems to be functioning normally.
I just want to check: did I do this properly? Is it normal to have an extra red wire, and if so, what is it for? This is my first time doing any home wiring, and I just want to make sure I haven't done anything wrong. Thanks for any help.