Execution Check
This commit is contained in:
parent
ae0d5b86ad
commit
aef5b5116d
@ -24,6 +24,8 @@ $router->get('/api/rooms/{roomId}/update', 'RoomsApi@update');
|
|||||||
$router->get('/api/devices', 'DevicesApi@default');
|
$router->get('/api/devices', 'DevicesApi@default');
|
||||||
|
|
||||||
$router->post('/api/widgets/{widgetId}/run', 'WidgetApi@run');
|
$router->post('/api/widgets/{widgetId}/run', 'WidgetApi@run');
|
||||||
|
$router->post('/api/widgets/{widgetId}/check', 'WidgetApi@check');
|
||||||
|
|
||||||
|
|
||||||
$router->any('/api/HA/auth', 'Oauth');
|
$router->any('/api/HA/auth', 'Oauth');
|
||||||
$router->any('/api/HA', 'GoogleHomeApi@response');
|
$router->any('/api/HA', 'GoogleHomeApi@response');
|
||||||
|
@ -14,4 +14,17 @@ class WidgetApi extends ApiController{
|
|||||||
|
|
||||||
$this->response(['value' => $response]);
|
$this->response(['value' => $response]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function check($subDeviceId){
|
||||||
|
//$this->requireAuth();
|
||||||
|
$response = null;
|
||||||
|
$lastRecord = RecordManager::getLastRecord($subDeviceId);
|
||||||
|
|
||||||
|
$response = [
|
||||||
|
'executet' => $lastRecord['execuded'],
|
||||||
|
'value' => $lastRecord['value'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->response($response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user