@extends('layouts.app') @section('title', 'Détails Capteur') @section('breadcrumb') @endsection @section('content')
@switch($sensor->type) @case('temperature') @break @case('humidity') @break @case('light') @break @case('co2') @break @case('ammonia') @break @case('water_level') @break @default @endswitch

{{ $sensor->name }}

{{ $sensor->is_active ? 'Actif' : 'Inactif' }}

{{ $sensor->code }}


Type: {{ ucfirst($sensor->type) }}

Bâtiment: {{ $sensor->building->name ?? 'Non assigné' }}

Lieu: {{ $sensor->location ?? '-' }}

Seuils: {{ $sensor->min_threshold ?? '∞' }} - {{ $sensor->max_threshold ?? '∞' }}

Dernières Lectures
@forelse($sensor->readings as $reading) @empty @endforelse
Date / Heure Valeur Statut
{{ $reading->recorded_at->format('d/m/Y H:i:s') }} {{ $reading->value }} @if(($sensor->min_threshold && $reading->value < $sensor->min_threshold) || ($sensor->max_threshold && $reading->value > $sensor->max_threshold)) Hors limites @else OK @endif
Aucune lecture enregistrée pour le moment.
@endsection