@if ($total === 0)

{{ __('windows.empty') }}

@else {{-- summary --}}

{{ $open > 0 ? trans_choice('windows.open_count', $open, ['count' => $open]) : __('windows.all_closed') }}

{{ trans_choice('windows.sensor_count', $total, ['count' => $total]) }}

@foreach ($groups as $roomName => $sensors)
@foreach ($sensors as $sensor) @php $battery = $sensor->device->entities->firstWhere('type', 'battery'); $pct = $battery ? (int) data_get($battery->state, 'state.percent', 0) : null; @endphp
{{ $sensor->device->name }}
@if (! is_null($pct)) {{ __('devices.battery') }} ยท {{ $pct }}% @endif
@endforeach
@endforeach @endif