File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments