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
@@ -52,6 +52,9 @@ class PhoenixSensorRepository implements SensorRepository {
Future<Sensor> unplaceSensor(int id) async =>
Sensor.fromJson(await client.unplaceSensor(id));
@override
Future<String?> getVersion(int id) => client.getVersion(id);
@override
Stream<Map<String, dynamic>> sensorEvents() => realtime
.channelMessages('sensors')
@@ -11,6 +11,8 @@ abstract class SensorRepository {
{required int roomId, required double x, required double y});
Future<Sensor> unplaceSensor(int id);
Future<String?> getVersion(int id);
/// Stream of raw SensorsChannel messages. Each map contains an `event` key
/// (`sensor_announced` or `sensor_enrollment_timeout`) plus the payload.
Stream<Map<String, dynamic>> sensorEvents();