diff --git a/assets/scripts/deviceSettings.js b/assets/scripts/deviceSettings.js index a92bd8898583c105d08283fb866b240396f0718f..87f7a5b362f7f675a27e11f6948d54b6f9fb09fe 100644 --- a/assets/scripts/deviceSettings.js +++ b/assets/scripts/deviceSettings.js @@ -6,14 +6,13 @@ async function saveDeviceSettings() { if(shortPress != '') { - await fetch('/executeAction', { + await fetch('/action/shortDelay', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ 'address': Number(originalAddress), - 'action': 4, 'value': Number(shortPress) }) }).then(response => response.json()).then(data => { @@ -23,7 +22,7 @@ async function saveDeviceSettings() { if(longPress != '') { - await fetch('/executeAction', { + await fetch('/action/longDelay', { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -40,7 +39,7 @@ async function saveDeviceSettings() { if(address != originalAddress) { - fetch('/executeAction', { + fetch('/action/address', { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/src/Controller/ActionController.php b/src/Controller/ActionController.php index 6c4dedcfdf205faf91d66cb943d4e30bc3387600..29b9370cb7ccd62935ef2793a5d751ad4b215f32 100644 --- a/src/Controller/ActionController.php +++ b/src/Controller/ActionController.php @@ -75,6 +75,10 @@ class ActionController extends AbstractController 'power' => $this->webResetter->pressPowerButton($requestBody['address'], $requestBody['value']), 'reset' => $this->webResetter->pressResetButton($requestBody['address'], $requestBody['value']), 'locate' => $this->webResetter->locateLED($requestBody['address'], $requestBody['value']), + 'shortDelay' => $this->webResetter->shortDelay($requestBody['address'], $requestBody['value']), + 'longDelay' => $this->webResetter->longDelay($requestBody['address'], $requestBody['value']), + 'address' => $this->webResetter->changeAddress($requestBody['address'], $requestBody['value']), + 'resetController' => $this->webResetter->reset($requestBody['address']), default => throw $this->createNotFoundException(), };