add meteo home board
This commit is contained in:
19
app/Http/Controllers/AutomationController.php
Normal file
19
app/Http/Controllers/AutomationController.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AutomationController extends Controller
|
||||
{
|
||||
public function home()
|
||||
{
|
||||
$url = "http://192.168.1.32/meteo/meteo/api/?device=all&instant";
|
||||
$client = new \GuzzleHttp\Client();
|
||||
|
||||
$promise = $client->requestAsync('GET', $url);
|
||||
$response = $promise->wait();
|
||||
|
||||
return $response->getBody()->getContents();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user