fix: byos firmware setting overrides cloud

This commit is contained in:
Benjamin Nussbaum 2025-05-30 21:00:44 +02:00
parent ae66d15051
commit d6533c4447

View file

@ -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;
}