PHP_SMART_HOME_V3/public/js/automation.js

35 lines
946 B
JavaScript
Raw Normal View History

function restartAutomation(automationId){
console.log("restartingAutomation" + automationId);
$.ajax({
url: 'ajax',
type: 'POST',
data: {
"automation_id" : automationId,
2019-10-11 15:41:58 +00:00
"action": "restart"
},
success: function(data){
console.log(data);
},
error: function (request, status, error) {
console.log("ERROR ", request, error);
}
});
}
2019-10-11 15:41:58 +00:00
function toggleAutomation(automationId){
console.log("togglingAutomation" + automationId);
$.ajax({
url: 'ajax',
type: 'POST',
data: {
"automation_id" : automationId,
2019-10-11 15:41:58 +00:00
"action": "deactive"
},
success: function(data){
2019-10-11 15:35:06 +00:00
$('#automation-'+automationId).toggleClass("is-inactive");
},
error: function (request, status, error) {
console.log("ERROR ", request, error);
}
});
}