From d6533c44472200c2c3631d33e6556db228858bac Mon Sep 17 00:00:00 2001 From: Benjamin Nussbaum Date: Fri, 30 May 2025 21:00:44 +0200 Subject: [PATCH] fix: byos firmware setting overrides cloud --- app/Models/Device.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Models/Device.php b/app/Models/Device.php index 38c3ac6..beda368 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -60,11 +60,11 @@ class Device extends Model public function getUpdateFirmwareAttribute(): bool { - if ($this->proxy_cloud_response && $this->proxy_cloud_response['update_firmware']) { + if ($this->update_firmware_id) { return true; } - if ($this->update_firmware_id) { + if ($this->proxy_cloud_response && $this->proxy_cloud_response['update_firmware']) { return true; } @@ -73,10 +73,6 @@ class Device extends Model public function getFirmwareUrlAttribute(): ?string { - if ($this->proxy_cloud_response && $this->proxy_cloud_response['firmware_url']) { - return $this->proxy_cloud_response['firmware_url']; - } - if ($this->update_firmware_id) { $firmware = Firmware::find($this->update_firmware_id); if ($firmware) { @@ -88,6 +84,10 @@ class Device extends Model } } + if ($this->proxy_cloud_response && $this->proxy_cloud_response['firmware_url']) { + return $this->proxy_cloud_response['firmware_url']; + } + return null; }