homeos/app/Events/DeviceDiscovered.php

28 lines
739 B
PHP

<?php
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
/** A new device was discovered on the network — live-updates the "Neue Geräte" panel. */
class DeviceDiscovered implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public function __construct(public string $findingUuid) {}
public function broadcastOn(): array
{
return [new PrivateChannel('discovery')];
}
public function broadcastAs(): string
{
return 'DeviceDiscovered';
}
}