Commit iniziale

This commit is contained in:
2025-08-05 14:10:01 +02:00
commit 097b7e922d
505 changed files with 227792 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Http;
class HomeAssistantAPI extends Model
{
use HasFactory;
public static function getSensorState($sensor)
{
$result=Http::withHeaders(
[
'Authorization'=>'Bearer '.env('HA_TOKEN'),
'Content-Type'=>'application/json',
]
)->get('https://ha.lavorain.cloud/api/states/'.$sensor);
return json_decode($result);
}
}