mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Simple Home (Google Oauth 2.0) Flow type - code
This commit is contained in:
1 parent
135dfcb666
commit
541ea0002f
13 files changed
+243
-42
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user