Hide settings rows whose key the aircraft cannot read

The Mavic Pro remote reports GIMBAL_CONTROL_SPEED_COEFFICIENT as supported but
fails every read, so "Gimbal dial speed" sat on "—" forever. The key bridge
now reports a failed seeding read, and the row hides like an unsupported one
until a value does arrive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-10-22 14:51:14 +02:00
1 parent a813648b75
commit e3917e6f25
4 files changed
+31 -2

No files matched your search

+11
View File
@@ -146,6 +146,17 @@ void main() {
expect(m.keys.value(SettingsKeys.novice), isNull);
});
test('a supported key that cannot be read hides its row until a value arrives', () {
final FlightModel m = connectedModel(phantom4);
final TelemetryReducer r = TelemetryReducer(m);
m.keys.setSupported(SettingsKeys.gimbalDialSpeed, true);
r.apply(<String, dynamic>{'type': 'key', 'id': SettingsKeys.gimbalDialSpeed.id, 'unreadable': true});
expect(m.keys.supported(SettingsKeys.gimbalDialSpeed), isFalse);
r.apply(<String, dynamic>{'type': 'key', 'id': SettingsKeys.gimbalDialSpeed.id, 'value': 40});
expect(m.keys.supported(SettingsKeys.gimbalDialSpeed), isNot(isFalse));
expect(m.keys.value(SettingsKeys.gimbalDialSpeed), 40);
});
test('subscriptions listen only to supported keys and cancel on dispose', () async {
final FakeDjiService dji = FakeDjiService()..unsupportedKeys.add('ESC_BEEPING_ENABLED');
final KeyState s = KeyState();