Align frontend device types with backend canonical list

Replaces the old frontend-only `router` type and adds the full set used
by the backend: network_appliance, home_security, home_appliance, watch,
pc, gaming_console. Adds an `apiName` getter to map camelCase enum values
to the snake_case strings the API expects. Updates the unknown device icon
to a question mark.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-28 16:44:34 -04:00
co-authored by Claude Sonnet 4.6
parent 23b8858259
commit e28eb349ba
4 changed files with 42 additions and 10 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ class BackendAPI {
if (owner != null && owner.isNotEmpty) params['owner'] = owner;
if (deviceType != null) {
params['device_type'] =
deviceType == DeviceType.unknown ? '' : deviceType.name;
deviceType == DeviceType.unknown ? '' : deviceType.apiName;
}
final response = await _dio.get('/devices', queryParameters: params);