FrontendCore.define('on-off-table', ['devicePackage' ], function () {
    return {
        onStart: function () {

            FrontendCore.requireAndStart('notification');

            $('.switch input').each( function(){

                var oTarget = this;

                $(oTarget).change( function() {

                    var sUrl = this.checked === true ? document.getElementById('enable-' + this.id).value : document.getElementById('disable-' + this.id).value ;

                    $.ajax({
                        url: sUrl,
                        type:  'post'
                    }).fail( function( response ) {
                        var sMessage = response.responseJSON.message !== undefined ? response.responseJSON.message : 'Sorry, something was wrong.';
                        FrontendMediator.publish( 'notification', { type : 'ko', message: sMessage } );
                        $(oTarget).click();
                    });
                });
            });

        }
    };
});


@@ -339,16 +339,100 @@
     var 
+oInput = this,%0D%0A%09                    sValue = oInput.checked,%0D%0A%09                    
 sUrl = t
@@ -558,17 +558,16 @@
 d).value
- 
 ;%0D%0A%0D%0A   
@@ -717,24 +717,223 @@
 sponse ) %7B%0D%0A
+%0D%0A%09                    if ( sValue === true ) %7B%0D%0A%09%09                    oInput.checked = false;%0D%0A%09                    %7D else %7B%0D%0A%09%09                    oInput.checked = true;%0D%0A%09                    %7D%0D%0A%0D%0A
             
@@ -1178,51 +1178,8 @@
 );%0D%0A
-                        $(oTarget).click();
 %0D%0A  

Set the radio to the previous status if there is a fail