config('services.dryer.api_key')])->acceptJson() ->connectTimeout(3)->timeout(7)->get($this->url('status'))->throw()->json() ?? []; } public function history(): array { return Http::withHeaders(['X-API-Key' => config('services.dryer.api_key')])->acceptJson() ->connectTimeout(3)->timeout(7)->get($this->url('history'), ['limit' => 60])->throw()->json() ?? []; } public function start(string $profile, int $targetTemperature, int $dryingTime): array { return $this->command('cycles/start', [ 'profile' => $profile, 'targetC' => $targetTemperature, 'durationMinutes' => $dryingTime, ]); } public function stop(): array { return $this->command('cycles/stop'); } public function acknowledge(): array { return $this->command('faults/acknowledge'); } private function command(string $path, array $payload = []): array { return Http::withHeaders(['X-API-Key' => config('services.dryer.api_key')])->acceptJson() ->connectTimeout(3)->timeout(7)->post($this->url($path), [ 'requestId' => 'dashboard-'.bin2hex(random_bytes(12)), ...$payload, ])->throw()->json() ?? []; } }