diff --git a/chm-ludl/J_Harmony.js b/chm-ludl/J_Harmony.js index a3de736..774ea6e 100644 --- a/chm-ludl/J_Harmony.js +++ b/chm-ludl/J_Harmony.js @@ -407,19 +407,23 @@ var Harmony = (function (api) { // If we have changes, update buttons. if (bChanged) { - application.sendCommandSaveUserData(true); - api.performLuActionOnDevice(deviceID, HAM_SID, 'UpdateButtons', {}); +// application.sendCommandSaveUserData(true); + // On Vera Wait a second to send the actual action, as it may have issues not saving all data on time. var deviceObj = api.getDeviceObject(deviceID); if (getTargetControllerType(deviceObj)) { - // Vera requires static JSON rewrite and reload. setTimeout(function() { - showBusy(false); - htmlSetMessage("Changes to the buttons made.
Now wait for reload to complete and then refresh your browser page!",false); - }, 3000); + api.performLuActionOnDevice(deviceID, HAM_SID, 'UpdateButtons', {}); + // Vera requires static JSON rewrite and reload. + setTimeout(function() { + showBusy(false); + htmlSetMessage("Changes to the buttons made.
Now wait for reload to complete and then refresh your browser page!",false); + }, 5000); + }, 1000); } else { + api.performLuActionOnDevice(deviceID, HAM_SID, 'UpdateButtons', {}); showBusy(false); htmlSetMessage("Changes to the buttons made.
Refresh your browser page!",false); - } + } } else { showBusy(false); htmlSetMessage("You have not changed any values.
No changes to the buttons made.",true); @@ -459,20 +463,23 @@ var Harmony = (function (api) { } // If we have changes, update buttons. if (bChanged) { +// application.sendCommandSaveUserData(true); // Wait a second to send the actual action, as it may have issues not saving all data on time. var deviceObj = api.getDeviceObject(deviceID); - application.sendCommandSaveUserData(true); - api.performLuActionOnDevice(deviceID, HAM_CHSID, 'UpdateDeviceButtons', {}); if (getTargetControllerType(deviceObj)) { - // Vera requires static JSON rewrite and reload. setTimeout(function() { - showBusy(false); - htmlSetMessage("Changes to the buttons made.
Now wait for reload to complete and then refresh your browser page!",false); - }, 3000); + api.performLuActionOnDevice(deviceID, HAM_CHSID, 'UpdateDeviceButtons', {}); + // Vera requires static JSON rewrite and reload. + setTimeout(function() { + showBusy(false); + htmlSetMessage("Changes to the buttons made.
Now wait for reload to complete and then refresh your browser page!",false); + }, 5000); + }, 1000); } else { + api.performLuActionOnDevice(deviceID, HAM_CHSID, 'UpdateDeviceButtons', {}); showBusy(false); htmlSetMessage("Changes to the buttons made.
Refresh your browser page!",false); - } + } } else { showBusy(false); htmlSetMessage("You have not made any changes.
No changes to the buttons made.",true);