[OBSOLETE] SwitchMania - create 4 different kinds of virtual switches

I was having the same issue as ‘calbruc’.

My switch was acting like an on/off instead of momentary. It didn’t matter whether I used the Michael Struck version, the SmartThings public version in github, or the SmartThing’s version in the Switch Mania github (using copy/paste since I got errors trying to use github integration). I did edit the appropriate lines in ‘My Virtual Switch Creator’ source file. I wasn’t seeing any errors in the logs. Further debugging and I realized that the issue was that I was first creating an on/off version of the switch and then went back & changed it to momentary. Looking at the code, the type really only matters when you first create it; it doesn’t matter in updates (the type internally really doesn’t change). Also, the Michael Struck version doesn’t seem to initialize properly at all, so that added to the confusion. I’m not totally sure what is wrong with the Michael Struck version; the symptoms are when the switch is created as a momentary, it gets changed to an on/off during the creation and its name gets changed to ‘MyVirtualSwitch’. You can go back & edit it to make things correct, but since it has already been created, it really stays on/off internally. Hope this helps future users.