feat: grab sensor firmware version for detail sheet

This commit is contained in:
2026-05-20 19:43:15 +02:00
parent e0a3d5e481
commit acbba735a0
6 changed files with 49 additions and 12 deletions
+5 -1
View File
@@ -7,6 +7,7 @@ class Sensor {
this.roomId,
this.x,
this.y,
this.version,
});
final int id;
@@ -16,6 +17,7 @@ class Sensor {
final int? roomId;
final double? x; // room relative
final double? y; // room relative
final String? version;
bool get isPlaced => roomId != null && x != null && y != null;
String get displayName => name ?? sensorId;
@@ -28,6 +30,7 @@ class Sensor {
roomId: json['room_id'] as int?,
x: (json['x'] as num?)?.toDouble(),
y: (json['y'] as num?)?.toDouble(),
version: json['version'] as String?,
);
Sensor copyWith({
@@ -35,7 +38,7 @@ class Sensor {
int? roomId,
double? x,
double? y,
double? rssiRef,
String? version,
}) =>
Sensor(
id: id,
@@ -45,5 +48,6 @@ class Sensor {
roomId: roomId ?? this.roomId,
x: x ?? this.x,
y: y ?? this.y,
version: version ?? this.version,
);
}