mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 07:27:47 +00:00
This commit is contained in:
parent
c67a182cf2
commit
b4b6286172
89 changed files with 672 additions and 666 deletions
|
|
@ -18,7 +18,7 @@ class CleanupDeviceLogsJob implements ShouldQueue
|
|||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Device::each(function ($device) {
|
||||
Device::each(function ($device): void {
|
||||
$keepIds = $device->logs()->latest('device_timestamp')->take(50)->pluck('id');
|
||||
|
||||
// Delete all other logs for this device
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class FetchProxyCloudResponses implements ShouldQueue
|
|||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Device::where('proxy_cloud', true)->each(function ($device) {
|
||||
Device::where('proxy_cloud', true)->each(function ($device): void {
|
||||
if (! $device->getNextPlaylistItem()) {
|
||||
try {
|
||||
$response = Http::withHeaders([
|
||||
|
|
|
|||
|
|
@ -18,12 +18,7 @@ class FirmwareDownloadJob implements ShouldQueue
|
|||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private Firmware $firmware;
|
||||
|
||||
public function __construct(Firmware $firmware)
|
||||
{
|
||||
$this->firmware = $firmware;
|
||||
}
|
||||
public function __construct(private Firmware $firmware) {}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,12 +17,7 @@ class FirmwarePollJob implements ShouldQueue
|
|||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private bool $download;
|
||||
|
||||
public function __construct(bool $download = false)
|
||||
{
|
||||
$this->download = $download;
|
||||
}
|
||||
public function __construct(private bool $download = false) {}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ class NotifyDeviceBatteryLowJob implements ShouldQueue
|
|||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$devices = Device::all();
|
||||
|
|
@ -32,9 +30,11 @@ class NotifyDeviceBatteryLowJob implements ShouldQueue
|
|||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip if battery is not low or notification was already sent
|
||||
if ($batteryPercent > $batteryThreshold || $device->battery_notification_sent) {
|
||||
if ($batteryPercent > $batteryThreshold) {
|
||||
continue;
|
||||
}
|
||||
if ($device->battery_notification_sent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue