device = $device; $this->name = $device->name; $this->roomId = $device->room_id; } public function saveName(): void { $this->validate(); $this->device->update(['name' => $this->name]); $this->flashMessage(__('devices.saved')); } public function saveRoom(): void { $this->validate(['roomId' => ['nullable', 'integer', 'exists:rooms,id']]); $this->device->update(['room_id' => $this->roomId ?: null]); $this->flashMessage(__('devices.saved')); } public function toggleStatus(): void { $this->device->update([ 'status' => $this->device->status === 'active' ? 'ignored' : 'active', ]); $this->flashMessage(__('devices.saved')); } // Mock command paths — Phase 3 routes these through DeviceCommandService → driver (H1). #[On('restartDevice')] public function restart(): void { $this->flashMessage(__('devices.command_sent_demo')); } public function checkUpdate(): void { $this->flashMessage(__('devices.no_update_demo')); } protected function flashMessage(string $message): void { $this->flash = $message; } public function render() { $this->device->load(['entities.state', 'room']); return view('livewire.devices.show', [ 'rooms' => Room::orderBy('sort')->orderBy('name')->get(), ]); } }