PHP_SMART_HOME_V3/app/templates/js/automation.js
2019-10-11 17:16:24 +02:00

35 lines
906 B
JavaScript

function restartAutomation(automationId){
console.log("restartingAutomation" + automationId);
$.ajax({
url: 'ajax',
type: 'POST',
data: {
"automation_id" : automationId,
"action": 'restart'
},
success: function(data){
console.log(data);
},
error: function (request, status, error) {
console.log("ERROR ", request, error);
}
});
}
function toggleAutomation(automationId){
console.log("togglingAutomation" + automationId);
$.ajax({
url: 'ajax',
type: 'POST',
data: {
"automation_id" : automationId,
"action": 'deactive'
},
success: function(data){
console.log(data);
},
error: function (request, status, error) {
console.log("ERROR ", request, error);
}
});
}