Cron Update
This commit is contained in:
parent
dffaf8eb2e
commit
3aab42d081
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
class CronApi extends ApiController {
|
class CronApi extends ApiController {
|
||||||
|
|
||||||
public function clean(){
|
public function clean(){
|
||||||
@ -8,7 +8,10 @@ class CronApi extends ApiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function fetch(){
|
public function fetch(){
|
||||||
echo (new VirtualDeviceManager)->fetch('');
|
//echo (new VirtualDeviceManager)->fetch('');
|
||||||
|
echo (new Covid)->fetch('');
|
||||||
|
echo (new OpenWeatherMap)->fetch('');
|
||||||
|
|
||||||
$this->response(['Value' => 'OK']);
|
$this->response(['Value' => 'OK']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ class EndpointsApi extends ApiController{
|
|||||||
'state' => 'succes',
|
'state' => 'succes',
|
||||||
'command' => $command,
|
'command' => $command,
|
||||||
], 200);
|
], 200);
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Log Data Save
|
//Log Data Save
|
||||||
@ -84,6 +85,11 @@ class EndpointsApi extends ApiController{
|
|||||||
$deviceLogManager->write("[Device Log Msg] Device_ID " . $device['device_id'] . "->" . $log, LogRecordTypes::ERROR);
|
$deviceLogManager->write("[Device Log Msg] Device_ID " . $device['device_id'] . "->" . $log, LogRecordTypes::ERROR);
|
||||||
unset($deviceLogManager);
|
unset($deviceLogManager);
|
||||||
}
|
}
|
||||||
|
$this->response([
|
||||||
|
'state' => 'succes',
|
||||||
|
'command' => $command,
|
||||||
|
], 200);
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Issuing command
|
// Issuing command
|
||||||
|
@ -13,7 +13,6 @@ class VirtualDeviceManager
|
|||||||
SubDeviceManager::create($deviceId, 'weather-nice', '');
|
SubDeviceManager::create($deviceId, 'weather-nice', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
var_dump($json['weather'][0]);
|
|
||||||
RecordManager::create($deviceId, 'weather-nice', $json['weather'][0]['main']);
|
RecordManager::create($deviceId, 'weather-nice', $json['weather'][0]['main']);
|
||||||
} else {
|
} else {
|
||||||
$deviceId = DeviceManager::create('1ee609f2fcf8048e84f1d2fb1d1d72b5', '1ee609f2fcf8048e84f1d2fb1d1d72b5')['device_id'];
|
$deviceId = DeviceManager::create('1ee609f2fcf8048e84f1d2fb1d1d72b5', '1ee609f2fcf8048e84f1d2fb1d1d72b5')['device_id'];
|
||||||
|
Loading…
Reference in New Issue
Block a user