Add maximum_compatibility boolean to devices to address redraw issues with certain hardware (#178)

This commit is contained in:
Jamie Shiell 2026-02-01 12:30:30 +00:00 committed by Benjamin Nussbaum
parent bcfc62c782
commit 9578251238
5 changed files with 54 additions and 1 deletions

View file

@ -45,6 +45,7 @@ test('device can fetch display data with valid credentials', function (): void {
'update_firmware' => false,
'firmware_url' => null,
'special_function' => 'sleep',
'maximum_compatibility' => false,
]);
expect($device->fresh())
@ -95,6 +96,27 @@ test('display endpoint omits image_url_timeout when not configured', function ()
->assertJsonMissing(['image_url_timeout']);
});
test('display endpoint includes maximum_compatibility value when true for device', function (): void {
$device = Device::factory()->create([
'mac_address' => '00:11:22:33:44:55',
'api_key' => 'test-api-key',
'maximum_compatibility' => true
]);
$response = $this->withHeaders([
'id' => $device->mac_address,
'access-token' => $device->api_key,
'rssi' => -70,
'battery_voltage' => 3.8,
'fw-version' => '1.0.0',
])->get('/api/display');
$response->assertOk()
->assertJson([
'maximum_compatibility' => true,
]);
});
test('new device is auto-assigned to user with auto-assign enabled', function (): void {
$user = User::factory()->create(['assign_new_devices' => true]);