Simple Home (Google Oauth 2.0) Flow type - code

This commit is contained in:
GamerClassN7
2021-04-05 10:43:30 +02:00
parent 135dfcb666
commit 541ea0002f
13 changed files with 243 additions and 42 deletions

View File

@@ -134,4 +134,29 @@ class WidgetApi extends ApiController
}
return RANGES[''];
}
public function edit($subDeviceId)
{
$this->requireAuth();
$allow = ["icon", "name"];
$response = null;
$obj = $this->input;
foreach ($obj as $key => $value) {
if (!in_array($key, $allow)){
unset($obj[$key]);
}
}
$subDeviceData = SubDeviceManager::edit($subDeviceId, $obj);
$response = [
"value" => "OK"
];
$this->response($response);
}
}