mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-03-14 20:33:40 +00:00
Add maximum_compatibility boolean to devices to address redraw issues with certain hardware (#178)
This commit is contained in:
parent
bcfc62c782
commit
9578251238
5 changed files with 54 additions and 1 deletions
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue