Linking Physical Switch with Virtual Switch Widget

I have tried Syncphysicalbutton.ino as an example of Arduino and it was working well with PUSH BUTTON. But the question is as usual my family are using SWITCH BUTTON. Any one can help with the code for Switch Button ? Thank you

@havanlinh As stated in previous post, I have moved your question to a new topic. But I was guessing a bit on the title.

Can you provide a bit more detail on what you are trying to do? Thank you.