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

add missing commands

parent 40ebb860
No related branches found
No related tags found
1 merge request!1Support for version 2
...@@ -70,4 +70,79 @@ class WebResetter ...@@ -70,4 +70,79 @@ class WebResetter
return true; return true;
} }
public function shortDelay(int $deviceID, int $delay): bool|string
{
$response = $this->httpClient->request(
'POST',
'http://' . $this->webResetterIp . '/delay/short',
[
'json' => [
'deviceID' => $deviceID,
'delay' => $delay,
'apikey' => $this->webResetterApikey
]
]
);
if($response->getStatusCode() != 200) {
return $response->getContent();
}
return true;
}
public function longDelay(int $deviceID, int $delay): bool|string
{
$response = $this->httpClient->request(
'POST',
'http://' . $this->webResetterIp . '/delay/short',
[
'json' => [
'deviceID' => $deviceID,
'delay' => $delay,
'apikey' => $this->webResetterApikey
]
]
);
if($response->getStatusCode() != 200) {
return $response->getContent();
}
return true;
}
public function changeAddress(int $deviceID, int $newAddress): bool|string
{
$response = $this->httpClient->request(
'POST',
'http://' . $this->webResetterIp . '/address',
[
'json' => [
'deviceID' => $deviceID,
'newAddress' => $newAddress,
'apikey' => $this->webResetterApikey
]
]
);
if($response->getStatusCode() != 200) {
return $response->getContent();
}
return true;
}
public function reset(int $deviceID): bool|string
{
$response = $this->httpClient->request(
'POST',
'http://' . $this->webResetterIp . '/address',
[
'json' => [
'deviceID' => $deviceID,
'apikey' => $this->webResetterApikey
]
]
);
if($response->getStatusCode() != 200) {
return $response->getContent();
}
return true;
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment