Skip to content

Commit 3d569da

Browse files
committed
Tries to wiggle ears
1 parent 8964355 commit 3d569da

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/Backend/sensors.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,22 @@ abstract class TriggerDefinition extends ChangeNotifier implements Comparable<Tr
241241
actionsToRun.add(baseAction);
242242
}
243243
//only adding a check here
244-
if (baseAction != null && (!baseAction.deviceCategory.toSet().containsAll(flattenedDeviceTypes) || (baseAction is CommandAction && hasLegacyEars))) {
244+
if (baseAction != null && ((baseAction is CommandAction && hasLegacyEars) || !baseAction.deviceCategory.toSet().containsAll(flattenedDeviceTypes) || (baseAction is EarsMoveList && !hasLegacyEars))) {
245245
// find the missing device type
246246
// The goal here is if a user selects multiple moves, send a move to all gear
247247
final Set<DeviceType> missingGearAction = baseAction.deviceCategory
248-
.whereNot(
248+
.where(
249249
// filtering out the first actions ears entry if its a unified move but legacy gear is connected
250-
(element) => DeviceType.ears == element && baseAction is CommandAction && hasLegacyEars,
250+
(element) {
251+
if (DeviceType.ears == element) {
252+
if (baseAction is CommandAction && hasLegacyEars) {
253+
return false;
254+
} else if (baseAction is EarsMoveList && !hasLegacyEars) {
255+
return false;
256+
}
257+
}
258+
return true;
259+
},
251260
)
252261
.toSet()
253262
.difference(flattenedDeviceTypes);

0 commit comments

Comments
 (0)