This code is getting the value from the switch widget and assigning it to the variable ‘x’. If your switch is set-up in the normal way then this will be. 0 (off) or a 1 (on).
As I said in an earlier post, it would help if you used meaningful variable names rather than just ‘x’. If your button on V0 is used to activate/deactivate the alarm system then change the name of variable ‘x’ to ‘alarm_activated’. That way, your code will be much more readable.