Skip to content
Snippets Groups Projects
Commit 138273a8 authored by Jonas Leder's avatar Jonas Leder
Browse files

implement new actions

parent e092c356
No related branches found
No related tags found
1 merge request!1Support for version 2
......@@ -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'
......
......@@ -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(),
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment