getTasksForDevice method

Gets all the tasks triggered for the specified device. If device is not part of either primaryDevices or connectedDevices, an empty set is returned.

Implementation

Set<TaskConfiguration?> getTasksForDevice(DeviceConfiguration device) {
  final Set<TaskConfiguration?> deviceTasks = {};

  for (var taskControl in taskControls) {
    if (taskControl.destinationDeviceRoleName == device.roleName) {
      deviceTasks.add(_taskMap[taskControl.taskName]);
    }
  }

  return deviceTasks;
}