HTTP-клиент к /api/v1 с Sanctum-токеном (хранится в secure storage), модели зеркалят Laravel API Resources. Экраны: логин, список устройств с живым статусом, детальная страница устройства (история телеметрии, turn-on/turn-off/set-level с проверкой capability), списки зон и правил автоматизации (пока только чтение — формы создания/редактирования впереди).
16 lines
439 B
Dart
16 lines
439 B
Dart
class Zone {
|
|
Zone({required this.id, required this.name, this.description, this.devicesCount});
|
|
|
|
final int id;
|
|
final String name;
|
|
final String? description;
|
|
final int? devicesCount;
|
|
|
|
factory Zone.fromJson(Map<String, dynamic> json) => Zone(
|
|
id: json['id'] as int,
|
|
name: json['name'] as String,
|
|
description: json['description'] as String?,
|
|
devicesCount: json['devices_count'] as int?,
|
|
);
|
|
}
|